Is there a method in ruby to turn fixnum like 74239 into an array like [7,4,2,3,9]?
74239
[7,4,2,3,9]
You can also use Array.new instead of map:
Array.new
map
n = 74239 s = Math.log10(n).to_i + 1 # Gets the size of n Array.new(s) { d = n % 10; n = n / 10; d }.reverse