C# O(n) solution
Implementation\n Time complexity: O(N) where N is the length of A.\n  Traversing the input array takes O(N). List.Add() is a O(1) operation. List.Reverse() is a
# Implementation\n* Time complexity: O(N) where N is the length of A.\n  Traversing the input array takes O(N). List.Add() is a O(1) operation. List.Reverse() is a O(N) operation. \n  \n* Space complexity: O(N)\n```\npublic class Solution {\n    public IList<int> AddToArrayForm(int[] A, int K) {\n         \n        int carry = K, i = A.Length - 1;\n        \n        List<int> res = new List<int>();\n        while(i >= 0 || carry > 0)\n        {\n            int val = i >= 0? A[i] : 0;\n            int sum = val + carry;\n            carry = sum / 10;\n            res.Add(sum % 10);\n            i--;\n        }\n        \n        res.Reverse();\n        return res;\n    }\n}\n```\n\n# Some thoughts\nUsing List.Insert() to build result from LSD (least significant digit)to MSD (most significant digit) will save a Reverse. However, List.Insert() is a O(N) operation, so below implemetation has O(N^2) time complexity.\n```\npublic class Solution {\n    public IList<int> AddToArrayForm(int[] A, int K) {\n        \n        char[] B = K.ToString().ToArray();\n        \n        int carry = 0, i1 = A.Length - 1, i2 = B.Length - 1;\n        List<int> res = new List<int>();\n        while(i1 >= 0 || i2 >= 0 || carry > 0)\n        {\n            int val1 = i1 >= 0? A[i1] : 0;\n            int val2 = i2 >= 0? B[i2] - \'0\' : 0;\n            int sum = val1 + val2 + carry;\n            carry = sum / 10;\n            res.Insert(0, sum % 10);\n            i1--;\n            i2--;\n        }\n        \n        return res;\n    }\n}\n```\n\nWe can also use LinkedList to build the result. Unlike List<T> whose underlying data structure is Array, LinkedList<T> underlying data structure is a double linked list. LinkedList.AddFirst() is a O(1) operation and we can use it to build the result from LSD to MSD. Below solution will have O(N) time complexity.\n```\npublic class Solution {\n    public IList<int> AddToArrayForm(int[] A, int K) {\n        \n        char[] B = K.ToString().ToArray();\n        \n        int carry = 0, i1 = A.Length - 1, i2 = B.Length - 1;\n        LinkedList<int> res = new LinkedList<int>();\n        while(i1 >= 0 || i2 >= 0 || carry > 0)\n        {\n            int val1 = i1 >= 0? A[i1] : 0;\n            int val2 = i2 >= 0? B[i2] - \'0\' : 0;\n            int sum = val1 + val2 + carry;\n            carry = sum / 10;\n            res.AddFirst(sum % 10);\n            i1--;\n            i2--;\n        }\n        \n        return new List<int>(res);\n    }\n}\n```
[]