Golang short and simple solution
Complexity\n- Time complexity: O(n)\n- Space complexity: O(1) - if we don\'t count additional elements produced by k. But it\'s limited to 4 as k <= 10^4\n\n\n#
# Complexity\n- Time complexity: O(n)\n- Space complexity: O(1) - if we don\'t count additional elements produced by k. But it\'s limited to 4 as k <= 10^4\n\n\n# Code\n```\nfunc addToArrayForm(num []int, k int) []int {\n    i := 1\n    for k > 0 {\n        if len(num) >= i {\n            k += num[len(num)-i]\n            num[len(num)-i] = k % 10\n        } else {\n            num = append([]int{k % 10}, num...)\n        }\n        i++\n        k = k / 10\n    }\n    return num\n}\n```
['Go']