C++ easy code with explanation
\n\n\n# Approach\n\n- Get the digits of the current number in an nums and insert them to a temporary array. Insert the numbers from the end of temporary array i
\n\n\n# Approach\n\n- Get the digits of the current number in an nums and insert them to a temporary array. Insert the numbers from the end of temporary array in the answer array. \nFor example\n\n- nums = [13,25,83,77]\n- Take the number 13.\nInsert 3 into a temporary array.\nInsert 1 in temporary array.\nTemporary array will have {3,1}\nStart from the end of temporary array and insert the digits into answer array.\nAnswer array will contain {1,3}.\n\n- Then take the number 25. \nInsert 5 into a temporary array.\nInsert 2 in temporary array.\nTemporary array will have {5,2}\nStart from the end of temporary array and insert the digits into answer array.\nAnswer array will contain {1,3,2,5}.\n\n- Follow the process until we reach the end of nums array.\n# Code\n```\nclass Solution {\npublic:\n    vector<int> separateDigits(vector<int>& nums) {\n        vector<int> ans;//contains answer\n\n        for(int i=0;i<nums.size();i++){\n            vector<int> temp;//The temporary vector used for storing digits of current number\n            int j=nums[i];//j is current number\n            while(j>0){\n                temp.push_back(j%10);//storing digits in temporary vector\n                j=j/10;\n            }\n            \n            for(int i=temp.size()-1;i>=0;i--){\n                ans.push_back(temp[i]);//Inserting the digits from temporary vector to answer vector\n            }\n        }\n        return ans;\n    }\n};\n```\n**Please upvote if it helped. Happy Coding!**
['C++']