I got this as a mock exam for day 2. 💀💀 Was given 24 mins to solve. Like wth.
@AkeemJonesajonesrock2 жыл бұрын
awesome video and great use of excel to show a graphical representation.
@untitled64835 ай бұрын
How did you reach this solution? I cannot even think about how to brute force it?
@seanclarke-12 жыл бұрын
My only problem with this is the BIG assumption being made here. You're assuming that in all cases, you can get the maximum number to it's desired cell position. The game involves flipping entire columns and rows. This means that you could be displacing an already maximised cell to achieve the maximisation of another cell. I know that it must be possible, since the problem is too large otherwise, but is there a proof you could add to show that it is always possible to achieve the maximum colour value in the upper left quadrant by only flipping rows and columns?
@shabrishpraveen12 жыл бұрын
Wow. I am happy someone asked me this This is exactly the question I had in my mind when I started. I wrote a brute force program and verified. Imagine a rubix. We will always be be able to bring the desired max value to specific cell.
@paladattadri74652 жыл бұрын
@@shabrishpraveen1 really same doubt which i got like @Sean Clarke, i didn't understand why this much complicated task for basic mock test, i thought to leave the test. Thank for your explanation.
@kumaranil1812 жыл бұрын
kzbin.info/www/bejne/Z5uqcqiqo62oj68 please check this for the extension where the example is also with 6*6 matrix and helps in imagining
@ktcoder2 жыл бұрын
@@shabrishpraveen1 Agree, in your example the flipping sequence will be C1 + R0 + C1
@karthiknaik70562 жыл бұрын
Good one and thanks Praveen! Liked the detailed explanations with examples. Hoping to see more such videos.
@shabrishpraveen12 жыл бұрын
Thank you, Sure karthik :)
@missbluesky25127 ай бұрын
Awesome video, thank you so much!
@helmetman2162 жыл бұрын
Great video Praveen, it is helping me a lot to understand. Keep up the good work
@trainguyen Жыл бұрын
sir, your explaination so fantastc. thanksss
@himanshubakshi41762 жыл бұрын
But 1 issue in this approach will be. When we are flipping the matrix for 2nd value, in that case the 1st value depending upon the row flipped will also change. Thus making the sum incorrect.
@yowpop36777 ай бұрын
thank you sir! i was able to understand the problem and how to solved it!
@arturtelezhkin632 Жыл бұрын
Nice explanation. Thank you
@shabrishpraveen1 Жыл бұрын
Glad it was helpful!
@LearnerH Жыл бұрын
thank you sir maza aa gya.
@prabinbasnet47412 жыл бұрын
Thank you!
@shabrishpraveen1 Жыл бұрын
You're welcome!
@TheSilentLooters8 ай бұрын
def flippingMatrix(matrix): n = len(matrix) // 2 total_sum = 0 for i in range(n): for j in range(n): total_sum += max(matrix[i][j], matrix[i][2 * n - 1 - j], matrix[2 * n - 1 - i][j], matrix[2 * n - 1 - i][2 * n - 1 - j]) return total_sum written in python3
@tadweber8140 Жыл бұрын
I need help with this, Im pretty sure my thought process was exactly yours.. ```int currentSum = matrix[i][j] + matrix[i][n-j-1] + matrix[m-i-1][j] + matrix[m-i-1][n-j-1];``` looping through every opposing value in the matrix but i keep coming up with 401 instead of 414...