Java Solution Using Stacks ||
\n\n# Code\n\nclass Solution {\n    public int[] separateDigits(int[] nums) {\n        List<Integer> temp = new ArrayList<>();\n        Stack<Integer> st = new 
\n\n# Code\n```\nclass Solution {\n    public int[] separateDigits(int[] nums) {\n        List<Integer> temp = new ArrayList<>();\n        Stack<Integer> st = new Stack<>();\n        \n        for(int i=0; i<nums.length; i++){\n            while(nums[i]>0){\n                int digit = nums[i] % 10;\n                st.push(digit);\n                nums[i] = nums[i] / 10;\n                \n            }\n            while(!st.empty()){\n                temp.add(st.peek());\n                st.pop();\n            }\n        }\n        int[] answer = new int[temp.size()];\n        for (int i = 0; i < temp.size(); i++) {\n            answer[i] = temp.get(i);\n        }\n        return answer;\n    }\n}\n```
['Math', 'Stack', 'Java']