First implementation of Integer.undigits
Rewrite undigits to avoid using Enum.reverse