Perfectly Solved.. check once..
\n\n# Code\n```\nclass Solution {\npublic:\n    vector addToArrayForm(vector& num, int k) {\n        vectorans;\n        vectorresult;\n        reverse(num.begi
\n\n# Code\n```\nclass Solution {\npublic:\n    vector<int> addToArrayForm(vector<int>& num, int k) {\n        vector<int>ans;\n        vector<int>result;\n        reverse(num.begin(),num.end());\n        int i=0;\n        int carry=0;\n        while(i<num.size() || k || carry){\n            // checking the condition in a single loop with style..\n            // handle i carefully when it exceeded num.size..\n           int first = (i < num.size()) ? num[i] : 0;\n           // this is the sum..\n            int sum= first+(k%10)+ carry;\n            // to check carry..\n            carry=sum/10;\n            // pushing back..\n            result.push_back(sum%10);\n            // updating loop condition..\n            k=k/10;\n            i++; \n        }\n        reverse(result.begin(),result.end());\n  return result;  }\n};
['C++']