Given a random non-negative number, you have to return the digits of this number within an array in reverse order.
35231 => [1,3,2,5,3]
0 => [0]
def digitize(n)
n.to_s.reverse.chars.map(&:to_i)
end
def digitize(n)
n.digits
end
Given a random non-negative number, you have to return the digits of this number within an array in reverse order.
35231 => [1,3,2,5,3]
0 => [0]
def digitize(n)
n.to_s.reverse.chars.map(&:to_i)
end
def digitize(n)
n.digits
end