comefrom: <doocs>0989.Add to Array-Form of Integer_1.py
code: def addToArrayForm( num: List[int], k: int) -> List[int]:
      i, carry = len(num) - 1, 0
      ans = []
      while i >= 0 or k or carry:
          carry += (0 if i < 0 else num[i]) + (k % 10)
          carry, v = divmod(carry, 10)
          ans.append(v)
          k //= 10
          i -= 1
      return ans[::-1]
masked: def sample_funcname ( var_0 : List [ int ] , var_3 : int ) -> List [ int ] :
      var_6 , var_8 = len ( var_0 ) - 1 , 0
      var_9 = [ ]
      while var_6 >= 0 or var_3 or var_8 :
          var_8 += ( 0 if var_6 < 0 else var_0 [ var_6 ] ) + ( var_3 % 10 )
          var_8 , var_12 = divmod ( var_8 , 10 )
          var_9.append ( var_12 )
          var_3 //= 10
          var_6 -= 1
      return var_9 [ : : - 1 ]
  