Digits
Converts an integer to an array of digits.
- Use
strconv.Itoa()
to convert the given number to a string,make()
andlen()
to create an appropriate slice. - Use
range
in combination withstrings.Split()
to iterate over the digits, converting them toint
usingstrconv.Atoi()
.