✅ JAVA || ArrayList || Loop || Iterative 💯🔥
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:  O(n*m) where n is the length of array and m is the max bit of the elements\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: O(n)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\n    public int[] separateDigits(int[] nums) {\n       List<Integer> ans = new ArrayList<>();\n        for (int num : nums) {\n            List<Integer> temp = new ArrayList<>();\n            while (num > 0) {\n                temp.add(num % 10);\n                num /= 10;\n            }\n            for (int j = temp.size() - 1; j >= 0; j--) {\n                ans.add(temp.get(j));\n            }\n        }\n        int[] result = new int[ans.size()];\n        for (int i = 0; i < ans.size(); i++) {\n            result[i] = ans.get(i);\n        }\n        return result;\n    }\n}\n```\n\n\n![image](https://assets.leetcode.com/users/images/54347e7f-1d1b-4153-bbac-039f9d3c5390_1675529014.557726.jpeg)\n
['Array', 'Java']