simple C++ code with explanation || comments added
\nclass Solution {\npublic:\n    vector<int> addToArrayForm(vector<int>& num, int k) {\n    vector<int>ans;\n      int carry=0;\n      \n     int i=num.size()-1
```\nclass Solution {\npublic:\n    vector<int> addToArrayForm(vector<int>& num, int k) {\n    vector<int>ans;\n      int carry=0;\n      \n     int i=num.size()-1;\n      while(i>=0 || carry>0 || k!=0 )\n     {\n       if(k!=0)  // here we are adding last digit of k in a[i] from last, and if after adding value is greater than 10\n                 \n      { carry+=k%10;\n       k/=10;}\n       \n        if(i>=0)\n       { carry+=num[i--];}\n       \n      ans.push_back(carry%10);// than we using carry%10 and left carry is stored by carry/=10 , and used further \n       carry/=10;\n     }\n      reverse(ans.begin(),ans.end());\n      return ans;\n    }\n};\nhoped you understood man , happy coding  (if you are an indian than definetly you will upvote this)\n```\n
['C', 'C++']