C++✔||Best and Easy Explanation ✔ ||  Detailed Explanation✔
Intuition\n Describe your first thoughts on how to solve this problem. \nThe problem asks us to separate the digits of each integer in an input array nums and r
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nThe problem asks us to separate the digits of each integer in an input array nums and return the separated digits in the same order as they appear in nums.\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n- Create an empty array ans to store the separated digits.\n- Loop through each integer in the input array nums.\n- Convert the integer to a string representation using the to_string function.\n- Loop through each character in the string representation and convert it back to an integer by subtracting the ASCII code of \'0\'.\n- Add the newly converted integer to the end of the ans array using push_back.\n- Return the ans array which now contains all the separated digits in the same order as they appeared in nums.\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\nO(n)\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\nO(n)\n\n# Code\n```\nclass Solution {\npublic:\n    vector<int> separateDigits(vector<int>& nums) {\n        vector<int> ans;\n        for( auto &it : nums ){\n            string tmp = to_string(it);\n            for( auto &s : tmp )\n             ans.push_back(s-\'0\');\n        }\n        return ans;\n    }\n};\n```
['C++']