Smallest subarray with sum greater than x🔥 | Array | Love Babbar DSA Sheet | Hindi

Sdílet
Vložit
  • čas přidán 9. 07. 2024
  • Time Stamps :
    Problem discussion : 0:00
    Approaching the problem : 02:10
    Dry Run Algorithm : 02:26
    Algorithm discussion : 05:40
    Code explanation : 07:32
    Time Complexity Discussion : 08:40
    Time Complexity : O(n)
    Space Complexity : O(1)
    Problem Link : practice.geeksforgeeks.org/pr...
    C++ Code Link : github.com/Ayu-99/Love-Babbar...
    Python Code Link: github.com/Ayu-99/Love-Babbar...
    Love Babbar DSA Sheet : drive.google.com/file/d/1FMdN...
    Please like, share and subscribe if you found the video useful. Feel free to ask in comments section if you have any doubts. :)
    #DataStructuresAndAlgorithms
    #LoveBabbarDSASheet
    #interviewpreparation
    Smallest subarray with sum greater than x solution
    Smallest subarray with sum greater than x Leetcode
    Smallest subarray with sum greater than x C++
    Smallest subarray with sum greater than x C++ Hindi
    Smallest subarray with sum greater than x Hindi
    Checkout the series: 🔥🔥🔥
    👉 Array: • Arrays
    👉 Recursion : • Recursion
    👉 Stack and Queue : • Stack And Queue
    👉 Greedy : • Greedy
    👉 Dynamic Programming : • Dynamic Programming
    👉 Leetcode contests : • Leetcode contests
    👉 Leetcode June Challenge : • Leetcode June Challenge
    👉 Leetcode July Challenge : • Leetcode July Challenge
    LIKE | SHARE | SUBSCRIBE 🔥🔥😊

Komentáře • 36

  • @SonuKumar-uq2rb
    @SonuKumar-uq2rb Před rokem +1

    way of teaching is mind-blowing God bless u, dear.

  • @fatehpreetsingh1440
    @fatehpreetsingh1440 Před 2 lety +1

    your videos are solving all my doubts,really thanks

  • @tusharjeena7081
    @tusharjeena7081 Před rokem

    best way of teaching

  • @garvitakbasantani5502
    @garvitakbasantani5502 Před 2 lety

    You explain so well!!!

  • @johndoe-cq3de
    @johndoe-cq3de Před 2 lety +2

    You could use a sliding window technique.. It passed all test cases.. This is in JS
    let left=0
    let count=0
    let res=Number.MAX_VALUE
    for(let i=0;ix){
    res=Math.min(res,i-left+1)
    count-=a[left++]
    }
    }
    return res

    • @AyushiSharmaDSA
      @AyushiSharmaDSA  Před 2 lety +2

      Thanks for sharing js code🙂

    • @johndoe-cq3de
      @johndoe-cq3de Před 2 lety

      @@AyushiSharmaDSA you're welcome 🙂

    • @biikaaa.6540
      @biikaaa.6540 Před 2 lety

      @@johndoe-cq3de what the hell is 'x'

    • @imshivendra
      @imshivendra Před 2 lety

      @@AyushiSharmaDSA is javascript code is allowed in interview? I don't think so.

    • @Nitian_Trader07
      @Nitian_Trader07 Před 8 měsíci

      @@biikaaa.6540 question mai dekh dhyan se bhai

  • @ANUJ-we3su
    @ANUJ-we3su Před 2 lety

    You are doing such a great work thanks mam.

    • @AyushiSharmaDSA
      @AyushiSharmaDSA  Před 2 lety

      Thank you :). Keep supporting and please share with your friends and juniors :)

  • @022_ananyasrivastava8
    @022_ananyasrivastava8 Před 2 lety

    Outstanding

  • @arshadansariv
    @arshadansariv Před 2 lety

    Didi your voice is choooo chweet☺🥰🤗🖤

  • @ecs185_shaileshbharti3

    Reach ++; 👍👍

  • @TekaneChaitanya
    @TekaneChaitanya Před 2 lety +1

    Please also explain java code if possible, it will be very helpful

  • @hackercoder8847
    @hackercoder8847 Před rokem

    didnt got time complexity part

  • @mrinalmadhav8119
    @mrinalmadhav8119 Před 2 lety

    Mam Walmart ko ctc kitti hai

  • @artishsharma7859
    @artishsharma7859 Před 2 lety

    Dude you have to add 51+0 not 55+0 check it: 4:20

  • @soumachatterjee9399
    @soumachatterjee9399 Před 2 lety

    Why not 45 + 19 > 51 ? Why not [45, 19] can be the smallest sub aaray ?

    • @04.nehalsingh12
      @04.nehalsingh12 Před 2 lety +2

      No we can't do this because in question it is mentioned a subarray and subarray is continuous we can't choose random element subarray means a continuous part of array

  • @Sonu-tg6tg
    @Sonu-tg6tg Před 2 lety

    if possible please explain code in java as well

  • @llo.welc_me
    @llo.welc_me Před rokem

    didi time comlexity samajh nahi aye thoda sa help kar dijie na

  • @Coder_421
    @Coder_421 Před 3 měsíci

    if value not found it should return zero testcase failing dude

  • @varunajmera
    @varunajmera Před 2 lety +1

    why we do not count while complexity? @ayushi

  • @imshivendra
    @imshivendra Před 2 lety

    Didi ye video samajh nahi aayi . 1 baar aap is question ka dusri approach ya video bata sakti hain kya?

  • @shaniyadav9117
    @shaniyadav9117 Před rokem

    Your code will not run, if the test case is:
    1 1
    1
    This test-case is the first test case at Date- 08/10/2022

    • @kirtimulchandani665
      @kirtimulchandani665 Před rokem

      Yes, we need to add another base case condition when we have a single element in the array. And if that element is greater than X, you will return 1 otherwise return 0.

  • @pratyushtripathi1728
    @pratyushtripathi1728 Před 8 měsíci +1

    Ekdam bekar 😢