We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
It took me a couple of hours to understand which elements of the matrix need to be summed in order to compute to the max sum, I still do not understand why this pattern applies? How could I have recoginised this symmetry?
Flipping the Matrix
You are viewing a single comment's thread. Return to all comments →
Python 3
It took me a couple of hours to understand which elements of the matrix need to be summed in order to compute to the max sum, I still do not understand why this pattern applies? How could I have recoginised this symmetry?
[ ['A', 'B', 'B', 'A'], ['C', 'D', 'D', 'C'], ['C', 'D', 'D', 'C'], ['A', 'B', 'B', 'A'] ]
`def flippingMatrix(matrix): n = len(matrix) // 2 max_sum = 0