Given an array-form integer and an integer K, add K to the array-form integer and return the result as an array. Pattern focus: Bit Addition. Process digits from the end and carry forward just like binary addition, but with base 10 digits.
num = array-form integer, k = integer to add
resulting integer in array form
Example 1:
Input:
num = [1,2,0,0] k = 34
Output:
[1,2,3,4]
Explanation:
1200 + 34 = 1234.
Example 2:
Input:
num = [2,7,4] k = 181
Output:
[4,5,5]
Explanation:
274 + 181 = 455.