C solution, 98 ms, 15.9 MB
\n\n\nint* addToArrayForm(int* num, int numSize, int k, int* returnSize){\n    int car = 0; int* returnNum;\n    *returnSize = numSize;\n    \n    for (int i = 
![image](https://assets.leetcode.com/users/images/5f628d40-07e1-4605-b8ae-a283bc9a2b94_1659748246.6982584.png)\n\n```\nint* addToArrayForm(int* num, int numSize, int k, int* returnSize){\n    int car = 0; int* returnNum;\n    *returnSize = numSize;\n    \n    for (int i = numSize - 1; i > -1; i--)\n    {\n        num[i] += ((k % 10) + car);\n        k /= 10;\n        \n        if (num[i] > 9)\n        {\n            car = 1;\n            num[i] %= 10;\n        }\n        else car = 0;\n    }\n    \n\t// i.e. if k.len > num.len and/or (num + k).len > num.len\n    if (k || car)\n    {\n        k += car;\n        int nlen = ((k) ? log10(k) + 1 : 0);\n        *returnSize += nlen;\n        returnNum = (int*) malloc(sizeof(int) * (*returnSize));\n        \n        for (int i = nlen - 1; i > -1; i--) \n        {\n            returnNum[i] = k % 10;\n            k /= 10;\n        }\n        for (int i = nlen; i < (*returnSize); i++) returnNum[i] = num[i - nlen];\n    }\n    else\n    {\n        returnNum = (int*) malloc(sizeof(int) * numSize); \n        for (int i = 0; i < numSize; i++) returnNum[i] = num[i];\n    }\n    \n    return returnNum;\n}\n```
['Array', 'C']