Number Of Subarrays With Bounded Maximum | Leetcode 795 Solution in Hindi

Sdílet
Vložit
  • čas přidán 13. 06. 2021
  • Please consume this content on nados.pepcoding.com for a richer experience. It is necessary to solve the questions while watching videos, nados.pepcoding.com enables that.
    NADOS also enables doubt support, career opportunities and contests besides free of charge content for learning. 1. We have an array 'arr' of positive integers, and two positive integers left and right (left is smaller than right).
    2. Return the number of (contiguous, non-empty) subarrays such that the value of the maximum array element in that subarray is at least left and at most right.
    Topic: #subArrays
    Used #DataStructure: #Arrays
    #TimeComplexity: O(n)
    #SpaceComplexity: O(1)
    --------------------------------------------------------------
    Linked Questions:
    1. Print All SubArrays : • Subarrays of an Array ...
    ---------------------------------------------------------------
    For detailed information and other exercises, VISIT: www.pepcoding.com
    Have a look at our result: www.pepcoding.com/placements​
    Follow us on our FB page: / pepcoding​
    Follow us on Instagram: / pepcoding​
    Follow us on LinkedIn: / pepcoding-education
    ----------------------------------------------------------------
    #subarrays, #learning, #coding, #leetcode, #gfg, #pepcoding, #boundedMax,#pepcodingSubarrays, #Arrays, #Strings, #dsa, #algorithms, #maths
    For a better experience and more exercises, VISIT: www.pepcoding.com/resources/
    Have a look at our result: www.pepcoding.com/placements
    Follow us on our CZcams page: / pepcoding
    Follow us on our FB page: / pepcoding
    Follow us on Instagram: / pepcoding
    Follow us on LinkedIn: / pepcoding-education
    Follow us on Pinterest: / _created
    Follow us on Twitter: home
    .
    .
    .
    Happy Programming !!! Pep it up 😍🤩
    .
    .
    .
    #pepcoding #code #coder #codinglife #programming #coding #java #freeresources #datastrucutres #pepcode #competitive #competitiveprogramming #softwareengineer #engineering #engineer

Komentáře • 27

  • @utkarshtripathi2349
    @utkarshtripathi2349 Před 2 lety +6

    bada hi gajab discussion rha, Thanks pepcoding for providing such great content free of cost.

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

    boht hi shandaar explainationt tha dimaag mai aya hi nhi prev count wala fanda pehle se khud se ,but ab bhoolunga nhi

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

    Thanks a lot Sir. Enjoyed your thorough walkthrough a lot.

  • @therandomchannel1205
    @therandomchannel1205 Před rokem

    awesome explanation

  • @hymnish_you
    @hymnish_you Před 3 lety +4

    Such an awesome explanation. Thank you.

    • @Pepcoding
      @Pepcoding  Před 3 lety +3

      Thankyou
      I am glad you liked it. I hope that you are watching till the end and trying to understand what, how, and especially why of the problem.
      If you like our efforts, will you like to write a few words about us here (www.quora.com/What-are-the-good-websites-to-learn-data-structures-and-algorithms )

  • @cricwhiz151
    @cricwhiz151 Před rokem

    thank you for the solution and great expiation

  • @ShivamSingh-zj4be
    @ShivamSingh-zj4be Před 2 lety +3

    Such an excellent explanation sir. Thank you!!

    • @Pepcoding
      @Pepcoding  Před 2 lety

      Glad you liked it!
      Keep learning.
      And for better experience, visit nados.io, where you will get well curated content and career opportunities.

  • @iuashrafi
    @iuashrafi Před 5 měsíci

    great !

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

    Best👌🔥🛐

  • @ditu-kunalsarda6863
    @ditu-kunalsarda6863 Před 3 lety +2

    Nice question, great explanation!

    • @Pepcoding
      @Pepcoding  Před 3 lety

      Thankyou
      I am glad you liked it. I hope that you are watching till the end and trying to understand what, how, and especially why of the problem.
      If you like our efforts, will you like to write a few words about us here (www.quora.com/What-are-the-good-websites-to-learn-data-structures-and-algorithms )

  • @ghazanferwahab5673
    @ghazanferwahab5673 Před rokem

    Bahut badiya smjhaya

  • @crackthecode1372
    @crackthecode1372 Před 3 lety +5

    Ye q itna clear ni hua

  • @siddhantkumar9492
    @siddhantkumar9492 Před 3 lety +1

    Sir shouldn't the complexity in the case of Brute Force be O(n3), because O(n2) complexity for finding all the sub-arrays and then traversal in that array will take O(n) for finding max. Please verify?

    • @rishabhyadav4994
      @rishabhyadav4994 Před 3 lety

      We can maintain a variable max and find max while calculating subarrays and check it that it lies in between bounds

    • @siddhantkumar9492
      @siddhantkumar9492 Před 3 lety

      @@rishabhyadav4994 okay. Then the time complexity stays the same as O(n2)

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

    great explaination

    • @Pepcoding
      @Pepcoding  Před 2 lety

      Love to hear that for better experience and well organised content sign up on nados.io and start learning.

  • @LegitGamer2345
    @LegitGamer2345 Před 3 lety +2

    nicee

  • @shashankjha4134
    @shashankjha4134 Před 3 lety

    Number of subarrays = n*n+1 / 2 , so shouldn't we add this in the final count instead of (ei-si+1) ?

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

      No bro number of subarrays formula will give all the sub arrays including the elements which are smaller the left but the ei-si+1 will give only those sub arrays whose ending index is ei

  • @utsavkumar4826
    @utsavkumar4826 Před 4 měsíci

    wrong answer, wont work for 213412