comefrom: <doocs>0935.Knight Dialer_1.py
code: def knightDialer( n: int) -> int:
      if n == 1:
          return 10
      f = [1] * 10
      for _ in range(n - 1):
          t = [0] * 10
          t[0] = f[4] + f[6]
          t[1] = f[6] + f[8]
          t[2] = f[7] + f[9]
          t[3] = f[4] + f[8]
          t[4] = f[0] + f[3] + f[9]
          t[6] = f[0] + f[1] + f[7]
          t[7] = f[2] + f[6]
          t[8] = f[1] + f[3]
          t[9] = f[2] + f[4]
          f = t
      return sum(t) % (10**9 + 7)
masked: def sample_funcname ( var_0 : int ) -> int :
      if var_0 == 1 :
          return 10
      var_4 = [ 1 ] * 10
      for var_6 in range ( var_0 - 1 ) :
          var_8 = [ 0 ] * 10
          var_8 [ 0 ] = var_4 [ 4 ] + var_4 [ 6 ]
          var_8 [ 1 ] = var_4 [ 6 ] + var_4 [ 8 ]
          var_8 [ 2 ] = var_4 [ 7 ] + var_4 [ 9 ]
          var_8 [ 3 ] = var_4 [ 4 ] + var_4 [ 8 ]
          var_8 [ 4 ] = var_4 [ 0 ] + var_4 [ 3 ] + var_4 [ 9 ]
          var_8 [ 6 ] = var_4 [ 0 ] + var_4 [ 1 ] + var_4 [ 7 ]
          var_8 [ 7 ] = var_4 [ 2 ] + var_4 [ 6 ]
          var_8 [ 8 ] = var_4 [ 1 ] + var_4 [ 3 ]
          var_8 [ 9 ] = var_4 [ 2 ] + var_4 [ 4 ]
          var_4 = var_8
      return sum ( var_8 ) % ( 10 ** 9 + 7 )
  