2 Approaches || ✅Easy-Eassssssy to understand 🔥|| Beginners friendly
IntuitionApproachComplexity
Time complexity:

Space complexity:
Code(First Approach)Code (Second Approach)
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->

# Approach
<!-- Describe your approach to solving the problem. -->

# Complexity
- Time complexity:
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity:
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code(First Approach)
```cpp []
class Solution {
public:
    vector<int> separateDigits(vector<int>& nums) {
        vector<int> ans;
        for (int i = 0; i < nums.size(); i++) {
            string temp = to_string(nums[i]);
            for (int j = 0; j < temp.length(); j++)
                ans.push_back(temp[j] - '0');
        }
        return ans;
    }
};
```

# Code (Second Approach)
```cpp []
class Solution {
 public:
    vector<int> separateDigits(vector<int>& nums) {
        vector<int> ans;
        int r = 0;
        for (int i = 0; i < nums.size(); i++) {
            if (nums[i] > 9) {
                vector<int> digits;
                while (nums[i] > 9) {
                    r = nums[i] % 10;
                    nums[i] /= 10;
                    digits.push_back(r);
                    if (nums[i] <= 9)
                        digits.push_back(nums[i]);
                }
                reverse(digits.begin(), digits.end());
                ans.insert(ans.end(), digits.begin(), digits.end());
            } else
                ans.push_back(nums[i]);
        }
        return ans;
    }
};

['Array', 'Math', 'String', 'C++']