mirror of
https://gitlab.com/mfocko/CodeWars.git
synced 2024-11-22 16:43:46 +01:00
22 lines
377 B
C#
22 lines
377 B
C#
|
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;
|
||
|
}
|
||
|
}
|
||
|
}
|