Number to Digits
tags: linear-scan
Write a function that takes a number and returns a list of its digits. For example, for input 2342 it should return [2,3,4,2].
|
|
The input is converted to a string and we scan through the string one by one and add it to the output array after it is converted to an integer.