1
0
Fork 0
mirror of https://gitlab.com/mfocko/CodeWars.git synced 2024-11-09 19:19:07 +01:00
CodeWars/8kyu/convert_number_to_reversed_digits/solution.cs

22 lines
377 B
C#
Raw Normal View History

using System;
using System.Collections.Generic;
namespace Solution
{
class Digitizer
{
public static long[] Digitize(long n)
{
long[] arr = new long[(int) Math.Log10(n + 0.5) + 1];
long n_tmp = n;
for (int i = 0, i_max = arr.Length; i < i_max; i++)
{
arr[i] = n_tmp % 10;
n_tmp /= 10;
}
return arr;
}
}
}