comefrom: <doocs>0877.Stone Game_1.py
code: def stoneGame( piles: List[int]) -> bool:
      n = len(piles)
      dp = [[0] * n for _ in range(n)]
      for i, v in enumerate(piles):
          dp[i][i] = v
      for i in range(n - 2, -1, -1):
          for j in range(i + 1, n):
              dp[i][j] = max(piles[i] - dp[i + 1][j], piles[j] - dp[i][j - 1])
      return dp[0][-1] > 0
masked: def sample_funcname ( var_0 : List [ int ] ) -> bool :
      var_1 = len ( var_0 )
      var_3 = [ [ 0 ] * var_1 for var_2 in range ( var_1 ) ]
      for var_4 , var_5 in enumerate ( var_0 ) :
          var_3 [ var_4 ] [ var_4 ] = var_5
      for var_4 in range ( var_1 - 2 , - 1 , - 1 ) :
          for var_6 in range ( var_4 + 1 , var_1 ) :
              var_3 [ var_4 ] [ var_6 ] = max ( var_0 [ var_4 ] - var_3 [ var_4 + 1 ] [ var_6 ] , var_0 [ var_6 ] - var_3 [ var_4 ] [ var_6 - 1 ] )
      return var_3 [ 0 ] [ - 1 ] > 0
  