You are given an integer represented as an array of digits in left-to-right order.
For example, the number 1321 is stored as [1, 3, 2, 1].
Your task is to add an integer k to this digit-array number and return the resulting number in the same array-form.
The answer should also be returned as an array of digits from most significant to least significant.
Input: num = [9, 9, 9], k = 1
Output: [1, 0, 0, 0]
Explanation:
999 + 1 = 1000
Input: num = [3, 4, 5], k = 555
Output: [9, 0, 0]
Explanation:
345 + 555 = 900
Input: num = [0], k = 73
Output: [7, 3]
Explanation:
0 + 73 = 73
Accepted:
Submission: