<doocs>0877.Stone Game_1.py
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
def sample_funcname ( var_0 : List [ int ] ) -> bool :
    var_5 = len ( var_0 )
    var_9 = [ [ 0 ] * var_5 for var_7 in range ( var_5 ) ]
    for var_11 , var_12 in enumerate ( var_0 ) :
        var_9 [ var_11 ] [ var_11 ] = var_12
    for var_11 in range ( var_5 - 2 , - 1 , - 1 ) :
        for var_15 in range ( var_11 + 1 , var_5 ) :
            var_9 [ var_11 ] [ var_15 ] = max ( var_0 [ var_11 ] - var_9 [ var_11 + 1 ] [ var_15 ] , var_0 [ var_15 ] - var_9 [ var_11 ] [ var_15 - 1 ] )
    return var_9 [ 0 ] [ - 1 ] > 0
