Leetcode Weekly Contest 403 | Video Solutions - A to D | by Viraj Chandra | TLE Eliminators

Поділитися
Вставка
  • Опубліковано 16 лип 2024

КОМЕНТАРІ • 28

  • @TLE_Eliminators
    @TLE_Eliminators  24 дні тому

    Please fill the feedback form: forms.gle/UetQqvq4TiZVZtbx7

  • @yashmalviya0149
    @yashmalviya0149 24 дні тому +7

    [2, -3, -7] taking subarrays [2, -3, -7] or [2, -3] and [-7] gives -2 as total cost but taking subarrays [2] and [-3, -7] gives you 6 as total cost...

  • @kavinshah4302
    @kavinshah4302 23 дні тому +2

    Very Well Explaination Viraj Sir !!

  • @amanasrani6405
    @amanasrani6405 21 день тому +1

    Here is my approach for the 2nd question
    class Solution {
    public:
    int findMax(const vector& indexArray) {
    if (indexArray.empty()) return -1;
    return *max_element(indexArray.begin(), indexArray.end());
    }
    int findMin(const vector& indexArray) {
    if (indexArray.empty()) return -1;
    return *min_element(indexArray.begin(), indexArray.end());
    }
    int minimumArea(vector& grid) {
    int rows = grid.size();
    int cols = grid[0].size();
    vector oneRowIndex;
    vector oneColIndex;
    for(int i = 0; i < rows; i++) {
    for(int j = 0; j < cols; j++) {
    if(grid[i][j] == 1) {
    oneRowIndex.push_back(i);
    oneColIndex.push_back(j);
    }
    }
    }
    if(oneColIndex.empty()) return 0;
    int minRow = findMin(oneRowIndex);
    int maxRow = findMax(oneRowIndex);
    int minCol = findMin(oneColIndex);
    int maxCol = findMax(oneColIndex);
    int height = maxRow - minRow + 1;
    int width = maxCol - minCol + 1;
    return height * width;
    }
    };

  • @prakashdeshmukh222
    @prakashdeshmukh222 24 дні тому +2

    Good explanation with how he thinks about the problem in the contest

  • @HarshSingh-pn1nw
    @HarshSingh-pn1nw 23 дні тому +2

    brother!!, beautiful explanation for 4th one

  • @rishabhjain563
    @rishabhjain563 24 дні тому +1

    amazing explanation of the d question!

  • @prabhjeetsingh6305
    @prabhjeetsingh6305 18 днів тому +1

    for 2nd question, I was not able to come up with this logic during the contest, now that I see this, it seems easy, but, would request you to suggest any other ideas too, though I understand that this is the easiest possible logic

  • @Abhay14
    @Abhay14 24 дні тому +1

    great explaination bhaiya 😊

  • @krishmakhija8333
    @krishmakhija8333 24 дні тому +1

    Great explanation of 4th ,understood competely

  • @vickyroy3595
    @vickyroy3595 24 дні тому +1

    Virajj !! Great explanation!!❤

  • @roshangeorge97
    @roshangeorge97 24 дні тому +1

    best mentor❤

  • @NeverGive-Up..26
    @NeverGive-Up..26 24 дні тому +1

    Understood

  • @-VLaharika
    @-VLaharika 23 дні тому +1

    The solution for third is giving TLE in java

  • @SumitKumar-du6vf
    @SumitKumar-du6vf 23 дні тому +1

    For Q3 how to tackle during the contest as their problem statements are such bullshit... though Excellent explanation brother🔥

  • @ashutoshpatel2050
    @ashutoshpatel2050 24 дні тому +2

    I was able to come up with the exact same approach for the 4th question but missed it just by some mins due to wrong coordinates , However Will memoizing the answer for a particular set of rectangles optimize the soln any further or there would be no overlapping rectangles?

    • @VirajChandra
      @VirajChandra 24 дні тому +1

      I did not think about this since this seemed within the TC boundaries.

  • @ammanchhetri6716
    @ammanchhetri6716 17 днів тому +1

    im going to see ur code.....just to copy those boxes you draw for future reference 😏

  • @23cash86
    @23cash86 24 дні тому +1

    Viraj 🫡🫡🫡

  • @omikakadiya151
    @omikakadiya151 24 дні тому +2

    very nice solution of 3rd and 4th bro

  • @user-su6fi6nd8b
    @user-su6fi6nd8b 24 дні тому +1

    No audio..😢

    • @TLE_Eliminators
      @TLE_Eliminators  24 дні тому

      The audio issue at some specific timestamp or in the entire video?

  • @jitushekkumar7083
    @jitushekkumar7083 24 дні тому +2

    bro use darkmode.

  • @Munnu-hs6rk
    @Munnu-hs6rk 24 дні тому +3

    Leetcode contest are so shit now

  • @vickyroy3595
    @vickyroy3595 24 дні тому +1

    whenever i see dp problem doing greedily!!🥲