Java easy to understand solution
\nclass Solution {\n    public List<Integer> addToArrayForm(int[] A, int K) {\n        LinkedList<Integer> res = new LinkedList<>();\n        int carry = 0;\n  
```\nclass Solution {\n    public List<Integer> addToArrayForm(int[] A, int K) {\n        LinkedList<Integer> res = new LinkedList<>();\n        int carry = 0;\n        int index = A.length - 1;\n        while(K > 0 || index >= 0){\n            int curK = K % 10;\n            int curA = index >= 0 ? A[index]: 0;\n            int curDigitSum = curK + curA + carry;\n            int toBeAdded = curDigitSum % 10;\n            carry = curDigitSum / 10;\n            index --;\n            K /= 10;\n            res.addFirst(toBeAdded);\n        }\n        if(carry != 0){\n            res.addFirst(1);\n        }\n        return res;\n    }\n}\n```
[]