C
IntuitionApproachComplexity
Time complexity:

Space complexity:
Code
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->

# Approach
<!-- Describe your approach to solving the problem. -->

# Complexity
- Time complexity:
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity:
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```c []
/**
 * Note: The returned array must be malloced, assume caller calls free().
 */
int* addToArrayForm(int* num, int numSize, int k, int* returnSize) {
    int* arr = malloc((numSize + 10) * sizeof(int));
    int i = numSize - 1, carry = k, j = 0;

    while (i >= 0 || carry > 0) {
        if (i >= 0) carry += num[i--];
        arr[j++] = carry % 10;
        carry /= 10;
    }

    for (int l = 0, r = j - 1; l < r; l++, r--) {
        int temp = arr[l];
        arr[l] = arr[r];
        arr[r] = temp;
    }

    *returnSize = j;
    return arr;
}

```
['C']