Problem can be found in here!
def addToArrayForm(nums: List[int], k: int) -> List[int]:
for i in range(len(nums)-1, -1, -1):
k, nums[i] = divmod(nums[i]+k, 10)
return [int(i) for i in str(k)] + nums if k else nums
Time Complexity: , Space Complexity: , where n is the length of array nums.