Easy Approach ( C++ )
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic\n    vector<int> addToArrayForm(vector<int>& nums, int k) {\n        int n=nums.size();\n        int i=n-1;\n        int carry=0;\n        vector<int> ans;\n        while(i>=0)\n        {\n            int dig=k%10;\n            k/=10;\n            int sum=nums[i]+dig+carry;\n            ans.push_back(sum%10);\n            carry=sum/10;\n            \n            i--;\n        }\n        while(k)\n        {\n            int dig=k%10;\n            k/=10;\n            int sum=dig+carry;\n            ans.push_back(sum%10);\n            carry=sum/10;\n        }\n        if(carry>0)\n        {\n            ans.push_back(carry);\n        }\n        reverse(ans.begin(),ans.end());\n        return ans;\n    }\n};\n```
['C++']