Easy Java Solution || Math
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\n\nclass Solution {\n\n    public List<Integer> addToArrayForm(int[] arr, int k) {\n        int n = arr.length;\n        int c = 0;\n        List<Integer> ans = new ArrayList<>();\n        String x = String.valueOf(k);\n        int idx = x.length()-1;\n        for(int i=n-1; i>=0; i--){\n            int a = arr[i];\n            int b = (idx>=0) ? x.charAt(idx--)-48 : 0;\n            int s = a+b+c;\n            if(s>=10){\n                c = s/10;\n                ans.add(0,s%10);\n            }else{\n                ans.add(0,s);\n                c=0;\n            }\n        }\n\n        if(x.length()>arr.length){\n            while(idx>=0){\n                int b = x.charAt(idx--)-48;\n                int s = b+c;\n                if(s>=10){\n                    c = s/10;\n                    ans.add(0,s%10);\n                }else{\n                    ans.add(0,s);\n                    c=0;\n                }\n            }\n        }\n        if(c!=0){\n            ans.add(0,c);\n        }\n        return ans;\n    }\n}\n```
['Java']