✅ JAVA || ArrayList || Loop || Iterative 💯🔥
\n\n# Code\n\nclass Solution {\n    public int[] separateDigits(int[] nums) {\n        ArrayList<Integer> list = new ArrayList<>();\n        for(int x : nums){\
\n\n# Code\n```\nclass Solution {\n    public int[] separateDigits(int[] nums) {\n        ArrayList<Integer> list = new ArrayList<>();\n        for(int x : nums){\n           List<Integer> temp = new ArrayList<>();\n            while (x > 0) {\n                temp.add(x % 10);\n                x = x/10;\n            }\n            for (int j = temp.size() - 1; j >= 0; j--) {\n                list.add(temp.get(j));\n            }\n        }\n        int [] result = new int[list.size()];\n        for(int i=0;i<list.size();i++){\n            result[i] = list.get(i);\n        }\n        return result;\n    }\n}\n```
['Array', 'Simulation', 'Java']