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

SdĂ­let
VloĆŸit
  • čas pƙidĂĄn 28. 07. 2024
  • Here are the video solutions for problems A, B, C, D of Leetcode Weekly Contest 403. We hope this will be useful for you in up-solving this contest.
    📱Check out handpicked problems by Priyansh himself, on our CP-31 sheet: www.tle-eliminators.com/cp-sheet
    Solution Codes:
    Problem A : leetcode.com/problems/minimum...
    Problem B : leetcode.com/problems/find-th...
    Problem C : leetcode.com/problems/maximiz...
    Problem D : leetcode.com/problems/find-th...
    Be sure to check out TLE Eliminators.
    Website: www.tle-eliminators.com/
    Instagram: / tle_eliminators
    Linkedin: / tle-eliminators
    Twitter: / tle_eliminators
    TLE Community Discord Server: / discord
    Timestamps:-
    0:00 Problem A
    9:10 Problem B
    20:10 Problem C
    37:10 Problem D

Komentáƙe • 28

  • @TLE_Eliminators
    @TLE_Eliminators  Pƙed měsĂ­cem

    Please fill the feedback form: forms.gle/UetQqvq4TiZVZtbx7

  • @yashmalviya0149
    @yashmalviya0149 Pƙed měsĂ­cem +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 Pƙed měsĂ­cem +2

    Very Well Explaination Viraj Sir !!

  • @prakashdeshmukh222
    @prakashdeshmukh222 Pƙed měsĂ­cem +2

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

  • @prabhjeetsingh6305
    @prabhjeetsingh6305 Pƙed měsĂ­cem +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

  • @HarshSingh-pn1nw
    @HarshSingh-pn1nw Pƙed měsĂ­cem +2

    brother!!, beautiful explanation for 4th one

  • @Abhay14
    @Abhay14 Pƙed měsĂ­cem +1

    great explaination bhaiya 😊

  • @rishabhjain563
    @rishabhjain563 Pƙed měsĂ­cem +1

    amazing explanation of the d question!

  • @krishmakhija8333
    @krishmakhija8333 Pƙed měsĂ­cem +1

    Great explanation of 4th ,understood competely

  • @roshangeorge97
    @roshangeorge97 Pƙed měsĂ­cem +1

    best mentor❀

  • @vickyroy3595
    @vickyroy3595 Pƙed měsĂ­cem +1

    Virajj !! Great explanation!!❀

  • @SumitKumar-du6vf
    @SumitKumar-du6vf Pƙed měsĂ­cem +1

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

  • @NeverGive-Up..26
    @NeverGive-Up..26 Pƙed měsĂ­cem +1

    Understood

  • @-VLaharika
    @-VLaharika Pƙed měsĂ­cem +1

    The solution for third is giving TLE in java

  • @ashutoshpatel2050
    @ashutoshpatel2050 Pƙed měsĂ­cem +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 Pƙed měsĂ­cem +1

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

  • @ammanchhetri6716
    @ammanchhetri6716 Pƙed 28 dny +1

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

  • @amanasrani6405
    @amanasrani6405 Pƙed měsĂ­cem +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;
    }
    };

  • @omikakadiya151
    @omikakadiya151 Pƙed měsĂ­cem +2

    very nice solution of 3rd and 4th bro

  • @23cash86
    @23cash86 Pƙed měsĂ­cem +1

    Viraj đŸ«ĄđŸ«ĄđŸ«Ą

  • @jitushekkumar7083
    @jitushekkumar7083 Pƙed měsĂ­cem +2

    bro use darkmode.

  • @user-su6fi6nd8b
    @user-su6fi6nd8b Pƙed měsĂ­cem +1

    No audio..😱

    • @TLE_Eliminators
      @TLE_Eliminators  Pƙed měsĂ­cem

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

  • @Munnu-hs6rk
    @Munnu-hs6rk Pƙed měsĂ­cem +3

    Leetcode contest are so shit now

  • @vickyroy3595
    @vickyroy3595 Pƙed měsĂ­cem +1

    whenever i see dp problem doing greedily!!đŸ„Č