Maximum Value Sum by Placing Three Rooks II (Leetcode BiWeekly 137)

Поділитися
Вставка
  • Опубліковано 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

КОМЕНТАРІ • 3

  • @TarunSantani
    @TarunSantani 26 днів тому

    Didn't understand the part of the pigeon hole principle. - how did you use it ?
    Can you explain it in somewhat easy way.

    • @soumyabhattacharjee1051
      @soumyabhattacharjee1051  26 днів тому +1

      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

    • @TarunSantani
      @TarunSantani 26 днів тому

      @@soumyabhattacharjee1051 ok thank you
      I will rewatch the video