Easiest solution | O(n) | Amazon |Facebook asked | 10 Lines of code
If you like my approach please do upvote!\n\nIn this we have converted a number to string so that we can add it\'s corresponding values easily!\n\nclass Solutio
If you like my approach please do upvote!\n\nIn this we have converted a number to string so that we can add it\'s corresponding values easily!\n```\nclass Solution {\npublic:\n    vector<int> addToArrayForm(vector<int>& A, int K) {\n        vector<int>v;\n        string p=to_string(K);\n        int l1=A.size()-1;\n        int l2=p.size()-1;\n        int carry=0;\n        int i=0;\n        while(l1>=0 || l2>=0){\n            \n            int sum=carry;\n            //here sum=sum+carry would be same as this s have written it like this only\n            if(l1>=0){\n                sum=sum+A[l1--];\n            }\n            if(l2>=0){\n                sum=sum+p[l2--]-\'0\';\n            }\n            v.push_back(sum%10);\n            carry=sum/10;\n            \n        }\n        if(carry>0){\n            v.push_back(carry);\n        }\n        reverse(v.begin(),v.end());\n        \n        return v;\n    }\n};\n```\n
['String', 'C']