Driver Code
if __name__ == " _ _ main _ _ " : NEW_LINE INDENT n = 4 NEW_LINE m = 4 NEW_LINE X = 6 NEW_LINE grid = [ [ 3 , 2 , 6 , 1 ] , [ 1 , 9 , 2 , 4 ] , [ 4 , 1 , 3 , 9 ] , [ 3 , 8 , 2 , 1 ] ] NEW_LINE ans = maxSum ( grid ) NEW_LINE print ( ans ) NEW_LINE DEDENT