How to solve the Codewars's Convert number to reversed array of digits

Today I try to solve the algorithm problem of codewars.


Convert number to reversed array of digits. Given a random number. You have to return the digits of this number within an array in reverse order.


348597 -> [7,9,5,8,4,3]


  • stack : last-in-first-out (LIFO) stack of objects.

  • valueOf() : Returns the string representation of the argument.

  • split() : returns array of strings computed by splitting.

  • parseInt() : returns the integer representation of the argument.

import java.util.*;

public class Kata {
    public static int[] digitize(long n) {
            # Codewars COC 정책으로 인하여 코드 제거
        return digits;
Written on December 9, 2018