Python solution to the split number problem.