You are viewing a single comment's thread. Return to all comments →
Python 3.8+ solution:
def flippingMatrix(matrix: list[list[int]]) -> int: return sum( max((row := matrix[i])[j], row[~j], (row := matrix[~i])[j], row[~j]) for i, j in itertools.product(range(len(matrix) // 2), repeat=2) )
Seems like cookies are disabled on this browser, please enable them to open this website
Flipping the Matrix
You are viewing a single comment's thread. Return to all comments →
Python 3.8+ solution: