💯 Beats || ✅Easy Java Solution || 😁Beginner Friendly solution
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n1. Count the size of th
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n1. Count the size of the array we have to return \n2. Create the array\n3. Fill the array using followed method\n\nNote: This code is very easy, if you have any doubts about how to do it please checkout my LinkedIn profile and messege me there i will explain you personally in details. Thank you\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\nO(N) is may be n^2 but is is minor so it is O(N).\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\nO(N)\n# Code\n```\nclass Solution {\n    public int[] separateDigits(int[] nums) {\n        \n        int size = 0;\n        for (int i : nums) {\n            while (i > 0) {\n                size++;\n                i /= 10;\n            }\n        }\n\n        int[] arr = new int[size];\n        for (int i = nums.length - 1; i >= 0; i--) {\n            int temp = nums[i];\n            while (temp > 0) {\n                arr[--size] = temp % 10;\n                temp /= 10;\n            }\n        }\n        return arr;\n    }\n}\n\n\n```\n![Please upvote.jpeg](https://assets.leetcode.com/users/images/29c71d99-9886-4d09-988f-edf08dc5175c_1716964655.301313.jpeg)\n
['Java']