java solution with complete explanation
\n//refer screenshot for explanation\n![image](https://assets.leetcode.com/users/images/fb0baa98-9a04-451a-92ec-e86406672045_1638670271.803106.png)\n\nclass Sol
```\n//refer screenshot for explanation\n![image](https://assets.leetcode.com/users/images/fb0baa98-9a04-451a-92ec-e86406672045_1638670271.803106.png)\n\nclass Solution {\n    public List<Integer> addToArrayForm(int[] num, int k) {\n        ArrayList<Integer> list = new ArrayList<>();\n        \n        for(int i=num.length-1; i>=0 || k>0; i--){\n            \n            if(i>=0){\n                list.add((num[i]+k)%10);\n                k=(num[i]+k)/10;\n            }\n            else{\n                list.add(k%10);\n                k/=10;\n            }\n        }\n        \n        Collections.reverse(list);\n      return list;\n    }\n}\n```\n
['Java']