<doocs>0723.Candy Crush_1.py
def candyCrush( board: List[List[int]]) -> List[List[int]]:
    m, n = len(board), len(board[0])
    run = True
    while run:
        run = False
        for i in range(m):
            for j in range(n - 2):
                if (
                    board[i][j] != 0
                    and abs(board[i][j]) == abs(board[i][j + 1])
                    and abs(board[i][j]) == abs(board[i][j + 2])
                ):
                    run = True
                    board[i][j] = board[i][j + 1] = board[i][j + 2] = -abs(
                        board[i][j]
                    )
        for j in range(n):
            for i in range(m - 2):
                if (
                    board[i][j] != 0
                    and abs(board[i][j]) == abs(board[i + 1][j])
                    and abs(board[i][j]) == abs(board[i + 2][j])
                ):
                    run = True
                    board[i][j] = board[i + 1][j] = board[i + 2][j] = -abs(
                        board[i][j]
                    )
        if run:
            for j in range(n):
                curr = m - 1
                for i in range(m - 1, -1, -1):
                    if board[i][j] > 0:
                        board[curr][j] = board[i][j]
                        curr -= 1
                while curr > -1:
                    board[curr][j] = 0
                    curr -= 1
    return board
def sample_funcname ( var_0 : List [ List [ int ] ] ) -> List [ List [ int ] ] :
    var_4 , var_6 = len ( var_0 ) , len ( var_0 [ 0 ] )
    var_8 = True
    while var_8 :
        var_8 = False
        for var_11 in range ( var_4 ) :
            for var_13 in range ( var_6 - 2 ) :
                if ( var_0 [ var_11 ] [ var_13 ] != 0 and abs ( var_0 [ var_11 ] [ var_13 ] ) == abs ( var_0 [ var_11 ] [ var_13 + 1 ] ) and abs ( var_0 [ var_11 ] [ var_13 ] ) == abs ( var_0 [ var_11 ] [ var_13 + 2 ] ) ) :
                    var_8 = True
                    var_0 [ var_11 ] [ var_13 ] = var_0 [ var_11 ] [ var_13 + 1 ] = var_0 [ var_11 ] [ var_13 + 2 ] = - abs ( var_0 [ var_11 ] [ var_13 ] )
        for var_13 in range ( var_6 ) :
            for var_11 in range ( var_4 - 2 ) :
                if ( var_0 [ var_11 ] [ var_13 ] != 0 and abs ( var_0 [ var_11 ] [ var_13 ] ) == abs ( var_0 [ var_11 + 1 ] [ var_13 ] ) and abs ( var_0 [ var_11 ] [ var_13 ] ) == abs ( var_0 [ var_11 + 2 ] [ var_13 ] ) ) :
                    var_8 = True
                    var_0 [ var_11 ] [ var_13 ] = var_0 [ var_11 + 1 ] [ var_13 ] = var_0 [ var_11 + 2 ] [ var_13 ] = - abs ( var_0 [ var_11 ] [ var_13 ] )
        if var_8 :
            for var_13 in range ( var_6 ) :
                var_16 = var_4 - 1
                for var_11 in range ( var_4 - 1 , - 1 , - 1 ) :
                    if var_0 [ var_11 ] [ var_13 ] > 0 :
                        var_0 [ var_16 ] [ var_13 ] = var_0 [ var_11 ] [ var_13 ]
                        var_16 -= 1
                while var_16 > - 1 :
                    var_0 [ var_16 ] [ var_13 ] = 0
                    var_16 -= 1
    return var_0
