#21 - Longest Substring Without Repeating Characters (Leetcode Medium) Interview Questions🔥

แชร์
ฝัง
  • เผยแพร่เมื่อ 18 ม.ค. 2025

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

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

    Support this video series, not by money,but by sharing it with your friend's circle 🙏

    • @surabhkumar2643
      @surabhkumar2643 2 ปีที่แล้ว

      Sir number send mm please

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

      Bhaiya aap bhi bs video dalte raho views and likes to aayenge hi aise content par

    • @rohitbarate1531
      @rohitbarate1531 2 ปีที่แล้ว

      Please make more videos on different problems

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

      let lonstr = function(s){
      if(!s){
      return 0;
      }
      let start = 0;
      let end = 0;
      let maxlength = 0
      const unqiueValue = new Set();
      while(end < s.length){
      if(!unqiueValue.has(s[end])){
      unqiueValue.add(s[end]);
      end++;
      maxlength = Math.max(maxlength,unqiueValue.size);
      }
      else{
      unqiueValue.delete(s[start]);
      start++;
      }
      }
      return maxlength;
      }
      console.log(lonstr("abcabcbb"));
      i have modify the code you and thanks for this tutorial this really help us

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

      I have one more query why we have written else condition when we are getting unique value by using set

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

    Please complete this series all the way to required concepts and questions for the interviews.

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

    @ajay bhai regularly ese problems ke video upload karte raho..it helps a lot to improve programming logic.

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

    I already solved this one ! Famous Problem DP❤️

  • @RavindraSingh-zg9eq
    @RavindraSingh-zg9eq ปีที่แล้ว +1

    how can u increment end value in else case ,buz ur dry run cases is not matching with written code.

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

      yes really not matching with written code ... what are you saying please review your video

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

    Hi @suneja vaiya, as per my understanding your code is not solving problem of “pwwkew”, as the 3rd sequence it will remove the char “p”. so we will loose “p”. If you can please give screenshot for the above example with correct output!!

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

      Hehehe.. I think you haven’t watched complete video 🙂

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

      Akash you are right, this code is incomplete. Ye correct solution nahi hai. 'else' ka logic incomplete hai.
      Jaise hi ek repeating character milgaya hame wo saare character nikalna padega Set se, from start index until we remove the duplicate character.
      Below wala asli solution hai.
      var lengthOfLongestSubstring = function(s) {
      if(!s) {
      return 0;
      }
      let end=0;
      let start=0;
      let max=0;
      let unique_char_set = new Set();
      while(end < s.length) {
      let c = s[end];
      if(!unique_char_set.has(c)) {
      unique_char_set.add(c);
      max=Math.max(max, unique_char_set.size);
      end++;
      } else {
      while(unique_char_set.has(c)) {
      unique_char_set.delete(s[start]);
      start++
      }
      }
      }
      return max;
      };

    • @akashsaha9366
      @akashsaha9366 2 ปีที่แล้ว

      @@srujanthegoldenboy ye sahi hain!!!. Good work bro! @suneja vaiya first of all thanks for the great explanation. 1 request hain jab bhi koi leetcode ka solution karte ho na tabhi har ek test case passed, usko dikha do. Nehi to humlog ko sab test ka solition nehi samajh aata.

    • @srujanthegoldenboy
      @srujanthegoldenboy 2 ปีที่แล้ว

      ​@@aiyushbedi you are right else ke under wala inner loop ki jaroorat nahi lag raha hai, mein test nahi kar raha hu. So you guys confirm if that works.
      Either way my solution will still work with same time complexity.
      Like you said the main video creator didn't explain the logic properly. He should have created proper good edge cases and explained them properly.

    • @JohnDoe-ej6vm
      @JohnDoe-ej6vm 2 ปีที่แล้ว +1

      I am sorry to say your understanding is wrong. i just tested the code it is accepted and passed all test cases.

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

    brother please continue the series ... my dsa is getting good because of you

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

    great explanation 😍😍😍😍😍😍😍😍

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

    Please continue with series. TH-cam has less video with Javascript DSA

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

    Thank you 😇

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

    please bring more videos on dsa

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

    JavaScript course is usefully

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

    Bhaiya please complete this series ❤

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

    Hi brother how are you 🥰🥰
    I'm waiting your DS & algorithms next video.....
    Advance thanks for you brother..
    I'm from Bangladesh..

  • @JohnDoe-ej6vm
    @JohnDoe-ej6vm 2 ปีที่แล้ว

    pehly mujhay laga ye code sab test cases k lye applicable nai hoga. then i tested and it worked.

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

    please complete this series, sir!

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

    thanks, alot. love from Pakistan

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

    I need to return string as well with max length. Please suggest.

  • @AnkitaSharma-tk9gx
    @AnkitaSharma-tk9gx 2 ปีที่แล้ว +2

    The answer is wrong. Your code uniqueCharatcters output is "acb" and not "abc" . And in the example, it is written that it should be a substring and not a subsequence. Please check the output substring in last which comes as acb and not abc in your code.

  • @ShubhamYadav-nu5tt
    @ShubhamYadav-nu5tt 2 ปีที่แล้ว +1

    bhai bohot badhiya explain ki hai aapne problem bas ek request hai khana please baad me kha liya karo chap chap ki avaz bohot irritating hai

  • @shreyashemma
    @shreyashemma 2 ปีที่แล้ว

    awesome brother ,make more videos like this

  • @royalsinghrajpoot4646
    @royalsinghrajpoot4646 2 ปีที่แล้ว

    Or videos laeye sir DSA par 👍👍🔥

  • @rohitbarate1531
    @rohitbarate1531 2 ปีที่แล้ว

    Please make more videos on different problems

  • @rohitpatel2671
    @rohitpatel2671 2 ปีที่แล้ว

    make on leetcode or gfg problems tutorial using javaScript

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

    if we have to print a unique substring not its count then this will not work. because if we take the string ( dbcab ) and if we have to print the unique character it will print only "cab". CORRECT ME IF I AM WRONG.

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

      I think , when it delete "b" but here we update start value does not end value, so while loops continue for end = 4 and the length of s is 5 bcz here we are not minus 1 in length. that's why it add "b" at the position of 4 then end value tobe 5 or while condition ( 5 < 5 ) false and terminate the loop.

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

    Bhai please flutter pe video banao, Indian market me flutter ki kya opportunities hain, kya scope h...

  • @sushantsaud7297
    @sushantsaud7297 2 ปีที่แล้ว

    Which language is best to learn dsa, can i used javascript

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

    Bhaiya Denouncing and Throttling ka video kab tk laoge

  • @amjadali-cs3si
    @amjadali-cs3si 2 ปีที่แล้ว

    sir course complete kab hoga apka dsa ka

  • @patelronak153
    @patelronak153 2 ปีที่แล้ว

    Please make more video on DSA JS🚀

  • @mohammadSameer-u4f
    @mohammadSameer-u4f ปีที่แล้ว

    if we want to return the string , not only length... , how we achieve this

  • @sadhnasharnagat9120
    @sadhnasharnagat9120 2 ปีที่แล้ว

    Pls make video for permutations and combinations ..

  • @shoebathar4941
    @shoebathar4941 2 ปีที่แล้ว

    Please provide some videos for linkedlist, graph, tree etc.

  • @dollyvishwakarm
    @dollyvishwakarm 2 ปีที่แล้ว

    Aur bhi questions kraya plz

  • @anilkumarjena6793
    @anilkumarjena6793 2 ปีที่แล้ว

    Hii I sir I have doubt, jab program else pe aeiga start srif increase hoga 'end' increase hoga nahi , kyun ki bo if condition pe jaega nahi.to end ka position 3 rahega uske bad badhega nahi

    • @dandendrasingh7326
      @dandendrasingh7326 2 ปีที่แล้ว

      First it will remove duplicate char in set when it is in else part and at if it will add it again to the set and then increase the end.

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

    bhai short video rkha kr or thoda jldi bola kr

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

    18:04

  • @praharshtembhurne8860
    @praharshtembhurne8860 2 ปีที่แล้ว

    What is the only book you recommend for DSA Javascript?

  • @swapnilbankar2402
    @swapnilbankar2402 2 ปีที่แล้ว

    Upload further DSA topics bro

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

    Mai maan gaya vai...!

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

    bhai please complete this series

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

    sir, ap ye kia kha rhe the parhate waqt ? 🙃

  • @Kaartus_gaming
    @Kaartus_gaming 2 ปีที่แล้ว

    bhaiya.. find k largest & kth largest element question pe explaination banaiye..

  • @NITINAGAM
    @NITINAGAM 2 ปีที่แล้ว

    Thank you for your efforts but you seem a bit confused while explaining the logic after the coding part and the code is incomplete.

  • @RajYadav-yh7vv
    @RajYadav-yh7vv ปีที่แล้ว

    bhai array ka length will be number of elements not from the zero

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

    Hi Bhaiya, Muze Infosys ka offer latter aya hai, 20 Feb ko Test aur 4 March Interview tha
    But mene Jan/2022 me bhi test ke liye apply kiya tha,but due to network issue,i was not able to attend this Test
    To kya ye offer letter valid rahega ,ya badme 6 month ke baad exam dene ke policy ke under muze Fired karenge

  • @dhirajjaiswal2941
    @dhirajjaiswal2941 2 ปีที่แล้ว

    Bhaiya please c++ ke sath dsa start Kar do na

    • @amjadali-cs3si
      @amjadali-cs3si 2 ปีที่แล้ว

      bhai ypoutube bhara para hindi mai bs dsa js mai nh hai eslye fav hai

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

    This is totally wrong the value will be ["B"] at the end at the max value will be 3.

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

    golmal

  • @SiddharthSingh-e2g
    @SiddharthSingh-e2g ปีที่แล้ว

    Explained wrong logic when start points to 3

  • @Optimized_Finance.
    @Optimized_Finance. 2 ปีที่แล้ว

    No English?

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

    Bhai tu mt hi bnaya kr ye videos pta ni kya hi h rata hua code likha h bus

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

    The ans is kew not wke

  • @yogeshbeldar6850
    @yogeshbeldar6850 2 ปีที่แล้ว

    Please complete this series all the way to required concepts and questions for the interviews.

  • @mrh2281
    @mrh2281 2 ปีที่แล้ว

    please bring more videos on dsa

  • @mrh2281
    @mrh2281 2 ปีที่แล้ว

    please bring more videos on dsa

  • @mrh2281
    @mrh2281 2 ปีที่แล้ว

    please bring more videos on dsa

  • @mrh2281
    @mrh2281 2 ปีที่แล้ว

    please bring more videos on dsa

  • @mrh2281
    @mrh2281 2 ปีที่แล้ว

    please bring more videos on dsa

  • @mrh2281
    @mrh2281 2 ปีที่แล้ว

    please bring more videos on dsa

  • @mrh2281
    @mrh2281 2 ปีที่แล้ว

    please bring more videos on dsa