Python 95% beats || 2 Approach || Simple Code
If you got help from this,... Plz Upvote .. it encourage me\n# Code\n# Approach 1 Array\n\nclass Solution(object):\n    def addToArrayForm(self, A, K):\n       
**If you got help from this,... Plz Upvote .. it encourage me**\n# Code\n# Approach 1 Array\n```\nclass Solution(object):\n    def addToArrayForm(self, A, K):\n        A[-1] += K\n        for i in range(len(A) - 1, -1, -1):\n            carry, A[i] = divmod(A[i], 10)\n            if i: A[i-1] += carry\n        if carry:\n            A = list(map(int, str(carry))) + A\n        return A\n\n```\n\n.\n\n# Approach 2 (By Convert list into number then add and then convert number into digit)\n```\nclass Solution:\n    def addToArrayForm(self, num: List[int], k: int) -> List[int]:\n        # List -> Number\n        n = 0\n        for ele in num:\n            n = (n*10) + ele\n        \n        n = n+k\n        \n        # Number -> List\n        num = []\n        while n > 0:\n            num.insert(0, n % 10)  \n            n //= 10 \n        return num\n```
['Array', 'Math', 'Python', 'Python3']