3 Sum | Brute - Better - Optimal with Codes

แชร์
ฝัง
  • เผยแพร่เมื่อ 5 ก.ย. 2024

ความคิดเห็น • 350

  • @takeUforward
    @takeUforward  ปีที่แล้ว +141

    Please do give us a like and subscribe, it won't cost you anything, but it will motivate me to make such kind of content more and more.

    • @utsavseth6573
      @utsavseth6573 ปีที่แล้ว +3

      Legendary stuff Raj bhai. Your explanation clearly shows you actually have a very strong depth on these fundamentals. And of course you do, you work for Google😉

    • @deepak8720
      @deepak8720 ปีที่แล้ว +2

      Awesome stuff. Liked and subscribed. Keep going. 👍

    • @pardhi8959
      @pardhi8959 11 หลายเดือนก่อน +1

      great content love u bhai

    • @pardhi8959
      @pardhi8959 11 หลายเดือนก่อน +1

      I start by like for all the video

    • @Bhai9866
      @Bhai9866 11 หลายเดือนก่อน

      Bhaiya code nhi chal raha hai 3 sum ki u give the condition sum is greater than 0 , less than 0 but didn't give the condition sum is equal to 0 why?

  • @luckshaeey
    @luckshaeey ปีที่แล้ว +241

    Tried 2 sum, 3 sum and 4 sum problems together as a beginner. It was so frustrating after a point before I understood the optimal approach 😂

    • @rishav144
      @rishav144 ปีที่แล้ว +5

      true bro

    • @it-51gulshanbhati89
      @it-51gulshanbhati89 ปีที่แล้ว +37

      u r strong bro u have tried all as a beginner 😅

    • @Akash-yr2if
      @Akash-yr2if ปีที่แล้ว +20

      You have a lot more experience than the whole comment section combined.

    • @user-ye4xi4py2k
      @user-ye4xi4py2k ปีที่แล้ว +8

      The optimal approach for 3sum is just the extension of optimal approach of 2 sum when the array given is sorted

    • @joeljacob4685
      @joeljacob4685 ปีที่แล้ว

      @@user-ye4xi4py2k yup !! you are right

  • @mehulthuletiya497
    @mehulthuletiya497 ปีที่แล้ว +65

    00:41 Problem Statement
    02:56 Brute force approach (Using 3-pointer)
    04:55 Pseudocode
    07:36 Code
    09:27 Complexity
    10:26 Better approach (Using Hashing)
    12:23 Dry run
    18:09 Code
    20:15 Complexity
    22:20 Optimal approach (Using 2-pointer)
    23:20 2-Pointer Technique
    31:50 Code
    36:41 Complexity

  • @rajatyadav4077
    @rajatyadav4077 2 หลายเดือนก่อน +15

    It's interesting-I initially tackled this problem with three nested loops, but when the time exceeded, I decided to find a way to eliminate one loop and ended up developing a two-pointer solution. Although I found the solution, I still enjoy watching Striver's videos to refresh my mind, spark creativity, and discover new approaches to problem-solving.

    • @karthikeyan.s2565
      @karthikeyan.s2565 2 หลายเดือนก่อน +7

      Bro 3 loops was the best I could think of, I can't able to optimize it
      How do you develop this logical thinking ?
      Could you help me with this ?

    • @user-hp9kj8qt1h
      @user-hp9kj8qt1h 2 หลายเดือนก่อน +2

      Me too pls

    • @graviton001
      @graviton001 หลายเดือนก่อน

      I also solved with two pointer approach on my own after 3 loops got time exceeded 😊 he built my logical thinking

    • @rajatyadav4077
      @rajatyadav4077 หลายเดือนก่อน +1

      @@karthikeyan.s2565
      This is a long process bro, keep in mind the techniques you have already employed and then try to come up with ideas for how we may shorten the loop as much as possible. Actually, after successfully answering an easy issue, I usually attempt to answer it in three or four ways (if at all feasible). Occasionally, after solving the problem, I peruse other people's answers on Leetcode to discover new strategies, and the Striker video assisted me in approaching the problem.

  • @S__Arslaan
    @S__Arslaan 11 หลายเดือนก่อน +5

    no need of condtion j

  • @shashankrajput8084
    @shashankrajput8084 4 หลายเดือนก่อน +12

    That's what a explanation beginner require for these type of problems

  • @Pamir026
    @Pamir026 ปีที่แล้ว +11

    Yes! I was onto this optimal approach but my implementation failed because I wasn't thinking it through. Simply lovely explanation!

  • @impalash_ag
    @impalash_ag 2 หลายเดือนก่อน +3

    Hi Raj, there are 2 slight mistakes in your optimal solution.
    1: The for loop will run till n-2 instead of n, because when i=n-1, j becomes n (j=i+1=n-1+1) and num[j] throws out of bound exception.
    2: We could also insert another check in the for loop(nums[i] = 1 there's no way any 3 elements sum would be 0 since the array is now sorted.
    3: Here's the more readable code(JAVA):
    class Solution {
    public List threeSum(int[] nums) {
    int n = nums.length;
    List result = new ArrayList();
    Arrays.sort(nums);
    for(int i=0; i low && nums[high] == nums[high+1])
    high--;
    }
    else {
    result.add(Arrays.asList(nums[i], nums[low], nums[high]));
    low++;
    high--;
    while(low < high && nums[low] == nums[low-1])
    low++;
    while(high > low && nums[high] == nums[high+1])
    high--;
    }
    }
    }
    }

    • @devanshkhandelwal7749
      @devanshkhandelwal7749 9 วันที่ผ่านมา

      However, since j < k condition fails, the inner loop won't run, and thus, the loop safely terminates.

  • @itzmartin20
    @itzmartin20 11 หลายเดือนก่อน +19

    Just cameback for a quick revision, and now it's indeed got into my head, thanks for your crystal clear intuition!

  • @abhijeetmishra3804
    @abhijeetmishra3804 11 หลายเดือนก่อน +4

    how can one explain so smoothly man...Hats of STRIVER bhaiya

  • @pragyatripathi8833
    @pragyatripathi8833 ปีที่แล้ว +9

    I love the way you teach bhayiya.❤❤ I don't have seen the teacher like you....you are God of DSA.

  • @subhranshuswayampravadash4656
    @subhranshuswayampravadash4656 ปีที่แล้ว +11

    Thanks brother for helping and providing us amazing solutions of the most important questions that asked in MNC's. Thanks a lot brother🙏

  • @swathigp3818
    @swathigp3818 4 หลายเดือนก่อน +2

    Great examples, which helps understand the algorithm very clearly even for non CSE folks!!

  • @sahulraj9536
    @sahulraj9536 6 หลายเดือนก่อน +1

    we can do a small improvement int the optimal code
    if nums[i]>0 then we can break the loop and return answer directly

  • @PrashantSingh-qr3vn
    @PrashantSingh-qr3vn ปีที่แล้ว +2

    Are u a genius how do u know what doubts a newbie would have . U r just superb in explaining the Algo

  • @shashankgsharma0901
    @shashankgsharma0901 หลายเดือนก่อน

    we can keep the indexes of the elements in the hashmap as well, in one loop; then while taking i and j, we can check whether the index is same as that of i or j or not. That would require less time complexity than the better solution.

  • @deepak8720
    @deepak8720 ปีที่แล้ว +3

    Completely Understood your explanation! Thank you for what you are doing, and please continue the good work. You are an amazing teacher. Have watched 3 videos of yours and I was able to understand all 3 with out any confusions. Big thumbs up for the video. 👍

  • @TheDivyansh007
    @TheDivyansh007 8 หลายเดือนก่อน +1

    When sum is less than 0 or greater than 0, then also we should skip for duplicates right? As sum will be same for the next duplicate value. EG: -4 -2 0 0 0 2 2 2. when i is at index 2, j is at index 3, and k is at the last index, and the sum is greater than 0, you want to skip duplicates for k as long as the value at k is the same as the previous one.

  • @jeet-smokey
    @jeet-smokey 6 หลายเดือนก่อน

    We will never get such a detailed explanation of 3 Sum problem. You are a Legend for reason....Striver.....!!!!

  • @AmartyaPardeshi
    @AmartyaPardeshi ปีที่แล้ว +3

    My man is doing God's work, thanks for this amazing playlist!

  • @ruchikaahujaasm
    @ruchikaahujaasm 4 หลายเดือนก่อน +1

    Explained all 3 approaches very clearly. Thank you so much!!!

  • @newbie8051
    @newbie8051 หลายเดือนก่อน

    Was asked in Adobe interview for DEI hiring for specially abled candidates.
    Woah, thanks !

  • @manvendrasingh4369
    @manvendrasingh4369 2 หลายเดือนก่อน

    While solving this problem, the very first approach which comes to my mind was optimal. Although the way I was handling duplicates was giving time limit exceeded error so I have to took help from gpt but rest of the logic was correct. Feeling extremely happy.

  • @priyanshusinha68
    @priyanshusinha68 4 หลายเดือนก่อน +1

    In the brute force approach discussed couldn't we have just sorted the array in the starting and then use 3 pointer technique instead of using sets

  • @codeman3828
    @codeman3828 19 วันที่ผ่านมา

    God bless you for all the help you do

  • @ahssanakhtar5746
    @ahssanakhtar5746 2 หลายเดือนก่อน

    Amazing content learn a lot every day from your course.Thanks for creating such an amazing course.

  • @sdakshin1
    @sdakshin1 3 หลายเดือนก่อน

    I found your explanation the best among all available... gd job

  • @ru2979
    @ru2979 ปีที่แล้ว +13

    never got an opportunity to do 3sum 😢 koi na LC pe hi krleta hu 🙂 seh lenge

  • @piyushroy3278
    @piyushroy3278 2 หลายเดือนก่อน

    Too good man, more and more kudos to you for such explanation. now im getting grip on building logic...finally.

  • @placement123
    @placement123 7 หลายเดือนก่อน

    when implementing the second approach instead of using set, we can use unordered_map(with the second key as its index), and we will start i from 0 and j from i+1 and for the third value we can ensure by checking that the index of the last target element from the map should be greater than j :)

    • @lakshsinghania
      @lakshsinghania 4 หลายเดือนก่อน

      hey, im not able to digest this thing in the 2nd approach
      arr is -1 0 1 2 -1 4
      and the i & j are pointing at -1 and -1 so arr[k] = -(-2) = 2 so for this we need to search in the entire array right
      and he stored [0 1 2] elements between -1 and -1
      but what if the arr was like this
      1 0 1 2 3 -4 and i is pointing to 1 and j pointing to 3 then arr[k] = -(4) = -4 then if we store [ 0 1 2 ] we will not find in the set as -4 is after the j pointer
      could u pls make me understand this as im bit confused

    • @CoDeEnthusiast-ev9zu
      @CoDeEnthusiast-ev9zu 3 หลายเดือนก่อน

      ​@@lakshsinghaniayou are right but there is a catch here ,
      When i is pointing to 1 and j is pointing to 3 we need to search for -4 in the hashset which is not available. However after that we will add the arr[j] into the hash set i.e. we will add the element 3 into hash set ..
      So in the next step j will point to 4 now we have to search for -(1-4) = 3 and this element 3 is present in the hashset thereby we will get the required unique triplet

  • @culeforever5408
    @culeforever5408 10 หลายเดือนก่อน +1

    understood and came up with the optimal solution myself almost same. just used an extra set to store triplets 😅

  • @rishav144
    @rishav144 ปีที่แล้ว +4

    God of DSA❤

  • @shubhamagarwal1434
    @shubhamagarwal1434 หลายเดือนก่อน

    #Free Education For All.. # Bhishma Pitamah of DSA...You could have earned in lacs by putting it as paid couses on udamey or any other elaerning portals, but you decided to make it free...it requires a greate sacrifice and a feeling of giving back to community, there might be very few peope in world who does this...."विद्या का दान ही सर्वोत्तम दान होता है" Hats Off to you man, Salute from 10+ yrs exp guy from BLR, India.....

  • @anuragprasad6116
    @anuragprasad6116 6 หลายเดือนก่อน +3

    3-sum code using 2 for loops and 1 while loop. Using for loops helps in more readability in this problem.
    // Sort the vector and create ans array.
    sort(arr.begin(), arr.end());
    vector ans;
    // Iterate the sorted array.
    for (int i = 0; i < n; i++) {
    // Make sure first element of triplet is unique.
    // Now whole array on right of 'i' is a 2-sum problem.
    if (i > 0 && arr[i] == arr[i-1]) continue;
    // Take -ith element as target.
    int twosum = -arr[i];
    int right = n-1;
    // Look for unique 2nd element in the search space. Notice that for
    // each unique i, the pairs that create 3sum with it are unique.
    // Similarily, for each unique j, the 3rd element will be unique.
    for (int j = i+1; j < right; j++) {
    // Looking only for unique 2nd element.
    if (j > i+1 && arr[j] == arr[j-1]) continue;
    // Look for its partner.
    while (j < right && arr[j] + arr[right] > twosum) right--;
    // No need to skip. All the 2nd elements are unique!
    if (arr[j] + arr[right] == twosum && j != right)
    ans.push_back({arr[i], arr[j], arr[right]});
    }
    }
    return ans;
    Similarily, 4sum can be broken down as: first unique element + 3sum in remaining search space.

  • @UECAshutoshKumar
    @UECAshutoshKumar 3 หลายเดือนก่อน +1

    Understood 👍

  • @lakshyarajsinghpanwar8523
    @lakshyarajsinghpanwar8523 ปีที่แล้ว +3

    Java Solution that is accepted on Leetcode:
    public List threeSum(int[] nums) {
    int n = nums.length;
    HashSet set = new HashSet();

    for (int i = 0; i < n - 2; i++) {
    HashSet s = new HashSet();

    for (int j = i + 1; j < n; j++) {
    int third = -(nums[i] + nums[j]);

    if (s.contains(third)) {
    List temp = new ArrayList();
    temp.add(nums[i]);
    temp.add(nums[j]);
    temp.add(third);
    Collections.sort(temp);
    set.add(temp);
    }

    s.add(nums[j]);
    }
    }

    List ans = new ArrayList(set);
    return ans;
    }

    • @mohitrawat8550
      @mohitrawat8550 ปีที่แล้ว

      Bro can please explain me new ArrayList(set); this line where u passed set how is this fetching List in hashset to arraylist of ans.

  • @prajjwaldeepghosh7329
    @prajjwaldeepghosh7329 ปีที่แล้ว +3

    Consdering the third solution cant we just use Set of List and return as List of List, then we avoid the two while loops :
    while(j

    • @sumanshekhar8110
      @sumanshekhar8110 ปีที่แล้ว

      But it will increase your space complexity, those two while loops are light loops so Strivers 3rd solution I think is best as its saves space.

  • @user-bj9qx9yf1o
    @user-bj9qx9yf1o ปีที่แล้ว +1

    Hi, you are doing extremely good work DSA topics. You making concepts very clear. Glad that I got your channel reference. But un luckily I am from JavaScript background , i am finding a resources like anything for DSA, I dint get any . Your help will be appreciated on this.

  • @nikhilnarvariya397
    @nikhilnarvariya397 ปีที่แล้ว +13

    Noice title 😉

  • @cinime
    @cinime ปีที่แล้ว +1

    Understood! Super amazing explanation as always, thank you very much for your effort!!

  • @Bakwas_baate
    @Bakwas_baate 3 หลายเดือนก่อน

    what a solution. MINDBLOWING!!!!

  • @arnd12940
    @arnd12940 หลายเดือนก่อน +1

    in better solution ;
    time complexicity :-> O(n^2 * log(no. of unique triplets))
    but for seraching to hashset using find and insert operation of hashset should we count ? why ?

  • @bopon4090
    @bopon4090 5 หลายเดือนก่อน

    Bro that hash map solution is so genius.

  • @moonlight-td8ed
    @moonlight-td8ed หลายเดือนก่อน

    dont forget to add if nums[i]>0: break at starting line in the for loop, since it is a sorted one, if your 1st element itself >0 then you cant find the sum that is ==0 so add this, which improves runtime drastically

  • @secretvibz6300
    @secretvibz6300 7 หลายเดือนก่อน +1

    As Smooth as Butter 😃

  • @Manishgupta200
    @Manishgupta200 ปีที่แล้ว

    Thanks for the in-depth explaination with in-depth time and space complexity

  • @anmjubaer
    @anmjubaer 9 หลายเดือนก่อน +2

    Great explanation but what about the time complexity of those 2 while loops from the optimal solution? Can you elaborate a bit here please?

  • @RahulKumar-zp1ln
    @RahulKumar-zp1ln ปีที่แล้ว

    THANK YOU FOR EXPLANING IN SIMPLE WAY

  • @user-st9ff2vh6l
    @user-st9ff2vh6l 8 หลายเดือนก่อน +1

    Understood

  • @satyapraneeth1078
    @satyapraneeth1078 11 หลายเดือนก่อน +1

    understood

  • @priyanshuagrawal7509
    @priyanshuagrawal7509 10 หลายเดือนก่อน +2

    Now i can finally answer someone if someone ask me have you done 3Sum 😆. Thanks Striver 😉

  • @priyankaghosh2670
    @priyankaghosh2670 ปีที่แล้ว

    best teacher in the world...........

  • @GhostVaibhav
    @GhostVaibhav 6 หลายเดือนก่อน +1

    Understood🔥

  • @Benstokes555
    @Benstokes555 7 หลายเดือนก่อน

    mind blown, dopamine released, love u striver

  • @RituSingh-ne1mk
    @RituSingh-ne1mk 8 หลายเดือนก่อน +1

    Understood!

  • @shrad6611
    @shrad6611 4 หลายเดือนก่อน

    If we directly use hashset and use pointer approach then we dont need to check many different conditions, which is easy for as a beginner
    class Solution {
    public List threeSum(int[] nums) {
    Arrays.sort(nums);
    HashSet res = new HashSet();
    for (int i = 0; i < nums.length; i++) {
    int lo = i+1, hi = nums.length-1;
    while (lo < hi) {
    int sum = nums[i] + nums[lo] + nums[hi];
    if (sum == 0) {
    res.add(Arrays.asList(nums[i], nums[lo], nums[hi]));
    lo++; hi--;
    }
    else if (sum < 0) lo++;
    else hi--;
    }
    }
    List resultList = new ArrayList(res);
    return resultList;
    }
    }

  • @VasanthChoudary-uc5cz
    @VasanthChoudary-uc5cz 10 หลายเดือนก่อน

    13:07 we can actually use a hashmap, by sorting and storing all the elements of given array as key and indexes as values. If 3rd element of triplet i.e. -(arr[i]+arr[j]) lies in the map and you don't want it to clash with value at current 1st and 2nd elements then simple check if index of that 3rd triplet ele in map is greater than index of 2nd triplet j.
    Arrays.sort(arr);//o(n*logn)
    HashMap map = new HashMap();
    for(int i=0;i > set = new LinkedHashSet();
    for(int i=0;i > list = new ArrayList(set);

    return list;

    • @misty6129
      @misty6129 9 หลายเดือนก่อน

      I have a doubt... Why are we running the i loop till less than n-2 and j till less than n-1

    • @VasanthChoudary-uc5cz
      @VasanthChoudary-uc5cz 9 หลายเดือนก่อน

      @@misty6129 according to my intuition which I mentioned above , i always lies before j and k , j always lies before k.

  • @jingfulin2322
    @jingfulin2322 5 หลายเดือนก่อน

    Great job! your code is so clean.

  • @_SahilShah
    @_SahilShah หลายเดือนก่อน

    Understood!
    I went somewhere near the optimal approach but wasnt able to come up with the concrete solution

  • @rohansingh6329
    @rohansingh6329 ปีที่แล้ว

    awsm video striver ❤❤ the free education you are providing is helping a us alot.

  • @firebout7675
    @firebout7675 8 หลายเดือนก่อน +1

    understoood

  • @welcometoc.s.easpirants
    @welcometoc.s.easpirants 9 หลายเดือนก่อน

    Awesome explaination. Thank u for such a great content.

  • @disciplines4
    @disciplines4 ปีที่แล้ว

    nice all the three approaches, helped a lot.

  • @sarangkumarsingh7901
    @sarangkumarsingh7901 5 หลายเดือนก่อน

    Another Awesome Lecture................

  • @eashan2405
    @eashan2405 ปีที่แล้ว +1

    Great explanation Striver ❤

  • @vishalgupta7522
    @vishalgupta7522 ปีที่แล้ว +2

    Line 29: Char 10: error: type 'vector' does not provide a call operator
    ans(st.begin(), st.end());
    ^~~
    1 error generated. brute force code

  • @user-yz6yk4vt6q
    @user-yz6yk4vt6q 6 หลายเดือนก่อน

    what a fantastic explantion!!!!

  • @samlinus836
    @samlinus836 ปีที่แล้ว

    Thank you bro, love from Tamil Nadu ❤

  • @dipingrover1970
    @dipingrover1970 6 หลายเดือนก่อน

    amazing exlanation , loved this video

  • @rahulraaja5056
    @rahulraaja5056 ปีที่แล้ว +1

    Great Explanation 💯💯

  • @gamingchampions4105
    @gamingchampions4105 11 หลายเดือนก่อน

    gained a subscriber with your amazing explanation

  • @joeljacob4685
    @joeljacob4685 ปีที่แล้ว

    Beautiful dry run!! Understood😄

  • @JackCoderr
    @JackCoderr ปีที่แล้ว

    Thank you so much bhaiya....you are the best teacher ❤❤❤

  • @VidhiJainB22CS083
    @VidhiJainB22CS083 2 หลายเดือนก่อน

    also, we can stop when nums[i] reaches some positive value in the most optimal solution, because after then zero cannot occur as our sum

  • @ruchirtd1
    @ruchirtd1 ปีที่แล้ว +5

    Understood!
    Java Solution that is accepted on Leetcode:
    class Solution {
    public List threeSum(int[] nums) {
    Set res = new HashSet();
    Arrays.sort(nums);
    for(int i=0;i

  • @Prashant-Dedha
    @Prashant-Dedha 7 หลายเดือนก่อน +1

    its java solution even if i copy paste from your sheet is not working, only 3 or 4 test cases are getting passed for brute and better solution.😫😫😫😫

  • @sayantanpoddar5428
    @sayantanpoddar5428 9 หลายเดือนก่อน

    understood!!! please came up with string series...please

  • @sayakghosh5104
    @sayakghosh5104 ปีที่แล้ว +1

    Awesome explanation....

  • @Sumeet_100
    @Sumeet_100 4 หลายเดือนก่อน +1

    Thank you ❤

  • @harshilpatel3205
    @harshilpatel3205 หลายเดือนก่อน

    Understood 🙏🏻

  • @a1_32_aarushi8
    @a1_32_aarushi8 ปีที่แล้ว

    Thank you so much sir for such a nice explanation your are super sir❤

  • @trinitykhuman
    @trinitykhuman 8 หลายเดือนก่อน

    I was looking for brute force approach tried myself but couldn't remember I have to used set DS but now , I can understand where I was wrong. Thanks for the tutorial.

  • @guneeshvats46
    @guneeshvats46 2 หลายเดือนก่อน

    Amazing explanation

  • @pranabpaul6317
    @pranabpaul6317 ปีที่แล้ว +1

    Understood

    • @aviralmishra181
      @aviralmishra181 ปีที่แล้ว

      I think it should work but it gives wrong answer on leetcode it does not passes all the testcases.
      If you find solution please comment back.

    • @pranabpaul6317
      @pranabpaul6317 ปีที่แล้ว +1

      @@aviralmishra181 class Solution {
      public:
      vector threeSum(vector& nums) {
      //first sort the array.
      sort(nums.begin(), nums.end());
      int n = nums.size();
      vector res;
      for(int i = 0; i < n-2; i++) {
      //to skip duplicate values in nums[i].
      if(i == 0 || i > 0 && nums[i] != nums[i-1]) {
      int low = i + 1;
      int high = n - 1;
      int sum = 0 - nums[i]; //reminder a+b+c = 0, so b+c = -a; nums[low] = b
      //nums[high] = c so if b + c = -a (can be found that will be the triplet.)
      while(low < high) {
      if(nums[low] + nums[high] == sum) {
      //means triplet found.
      vector temp;
      temp.push_back(nums[low]);
      temp.push_back(nums[high]);
      temp.push_back(nums[i]);
      res.push_back(temp);
      //to ignore duplicate values.
      while(low < high && nums[low] == nums[low + 1]) low++;
      while(low < high && nums[high] == nums[high - 1]) high--;
      //[....1 1 0....] after above loop low is in first 1 so do low++
      low++;
      high--;
      }
      else if(nums[low] + nums[high] < sum) {
      while(low < high && nums[low] == nums[low + 1]) low++;
      low++;
      //low++;
      }
      else {
      while(low < high && nums[high] == nums[high - 1]) high--;
      high--;
      //high--;
      }
      }
      }
      }
      return res;
      }
      };
      This code passes all the test cases try it.

  • @konankikeerthi
    @konankikeerthi 2 หลายเดือนก่อน

    Understood bro. Thank you

  • @arunprashanna7494
    @arunprashanna7494 ปีที่แล้ว

    Perfect explanation

  • @NazeerBashaShaik
    @NazeerBashaShaik 5 หลายเดือนก่อน

    Understood, thank you.

  • @user-if3ce9gm7p
    @user-if3ce9gm7p 2 หลายเดือนก่อน

    Understood sir thank you soo much sir

  • @hashcodez757
    @hashcodez757 3 หลายเดือนก่อน

    Mza aagya
    Understood!!

  • @tanya8353
    @tanya8353 8 หลายเดือนก่อน

    Great Job again !!

  • @rishabhsingh-gw3gf
    @rishabhsingh-gw3gf 11 หลายเดือนก่อน +6

    2 sum , 3 sum , 4 sum...what is this Google...Name it GANGBANG...KATHAM TATA BYE BYE SEE YOU 😂😂😂

  • @AniketKumar-hf2bo
    @AniketKumar-hf2bo 7 หลายเดือนก่อน

    understood ,thnx for explanation ❤❤❤❤❤❤👌👌💕💕💕💕

  • @vineetjadhav1785
    @vineetjadhav1785 26 วันที่ผ่านมา

    Gajab BHAI ❤❤❤❤❤❤

  • @user-xv7ms8bn2b
    @user-xv7ms8bn2b 3 หลายเดือนก่อน

    best explaination !!!

  • @nightgamer8953
    @nightgamer8953 10 หลายเดือนก่อน

    HashSet in C# still stores duplicate List in C# . Is there any alternatives in C# to store unique List of Integers?

  • @swacharahman5084
    @swacharahman5084 ปีที่แล้ว

    Thank you bhaiya, Love from bangladesh

  • @souravmehraniya2832
    @souravmehraniya2832 ปีที่แล้ว +1

    Keep going brother ❤

  • @AbhishekKumar-nz9dn
    @AbhishekKumar-nz9dn 11 หลายเดือนก่อน

    understood brilliantly 😘

  • @eruditecoder5215
    @eruditecoder5215 11 หลายเดือนก่อน

    I've 2 queries please resolve them
    1) Set datastructure stores sorted and unique elements only then why are we storing in temp and then sorting it.
    2) 2D vector "ans" is called only once at end so it will only have 1 list with all elements rather than list of lists

  • @anjigolla4853
    @anjigolla4853 ปีที่แล้ว

    superb explanation brother👏