Simple || Java || C++ || with Comments || 100% || 4 Lines Code || Readable || Beginners
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\n///// Method -- 1 Using By ArrayList\n\nclass Solution {\n    public int[] separateDigits(int[] nums) {\n            // create a array list type of Integer\n            ArrayList<Integer> al = new ArrayList<>();\n            // traversal on the array\n            for(int i = 0; i< nums.length; i ++) {\n                    // initialize an string and add with array element\n                    String s = nums[i]+ "";\n                    // now traversal on the string \n                    // after that add in array list and parseint\n                    for(int j = 0; j< s.length(); j ++) al.add(Integer.parseInt(s.charAt(j)+""));\n            }\n            // initialize the new answer array size of arraylist\n            int ans[] = new int[al.size()];\n            // now traversal on the arraylist and put all element in the answer array\n            for(int i = 0; i< al.size(); i++) ans[i] = al.get(i);\n            \n            return ans;\n    }\n}\n\n\n\n// Method -- 2 By Stack \n\n// class Solution {\n//     public int[] separateDigits(int[] nums) {\n//         int[] ans = new int[6000];\n//         int c = 0;\n//         for(int x:nums){\n//             Stack<Integer> s = new Stack<>();\n//             for(int y = x; y > 0; y /= 10)s.push(y%10);\n//             while(!s.isEmpty())ans[c++] = s.pop();\n//         }\n//         return Arrays.copyOf(ans, c);\n//     }\n// }\n\n```
['Java']