In Cody Problem 44293, Mehmet OZC asks us to spell numbers as words. For example, 67 would be “sixty-seven” and 76 would be “seventy-six”. Notice that the spelled-out versions are anagrams of each other.
Write a function to determine whether a number is an anagram number. The input number will be 1000 or smaller, and the function should also return a vector of numbers corresponding to the anagrams or an empty vector if there are none. One change from CP 44293 is to omit “and” in writing numbers larger than 100 (e.g., “one hundred seven” instead of “one hundred and seven”).
Solution Stats
Problem Comments
2 Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers8
Suggested Problems
-
Find all elements less than 0 or greater than 10 and replace them with NaN
15782 Solvers
-
Project Euler: Problem 3, Largest prime factor
1790 Solvers
-
Recurring Cycle Length (Inspired by Project Euler Problem 26)
161 Solvers
-
Find out the Gray Code for a Given Binary Number
118 Solvers
-
Find the nth term in the digit inventory sequence
20 Solvers
More from this Author323
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
Six of the possible random numbers in test case 6 are anagram numbers.
Thanks, Tim--fixed.