Maximum Value Sum by Placing Three Rooks II (Leetcode BiWeekly 137)
HTML-код
- Опубликовано: 12 сен 2024
- Watch in 1.5X
Here I have provided the solution and explanation of the 4th problem of Leetcode BiWeekly 137
Code: leetcode.com/c...
#leetcode #Leetcode #Weekly #programming #cp #codechef #codeforces
Didn't understand the part of the pigeon hole principle. - how did you use it ?
Can you explain it in somewhat easy way.
Pigeon hole principle says that if there are N numbers and we are taking N+1 numbers then at least one number bound to get repeated. Similar concept here, let say if the N+M-1 cells are from the same row and same column of the current cell and we take N+M+1 max cells then we are going to find the max and second max excluding all the cells of the current cell's row and column
If you find this helpful, please like and subscribe
@@soumyabhattacharjee1051 ok thank you
I will rewatch the video