Range Sum of Sorted Subarray Sums | Learning Something New | Leetcode 1508 | codestorywithMIK

Поділитися
Вставка
  • Опубліковано 12 вер 2024

КОМЕНТАРІ • 81

  • @codestorywithMIK
    @codestorywithMIK  Місяць тому +17

    Slight Correction - Approach-1 , we are sorting the temp array which contains all the subarray sums. So T.C : O(n^2 * log(n))

    • @himadrinath1502
      @himadrinath1502 Місяць тому

      bacco wala question hai.

    • @aws_handles
      @aws_handles Місяць тому

      Cool 🙌

    • @himadrinath1502
      @himadrinath1502 Місяць тому

      @@aws_handles leetcode ka 60% question kar loga agar priority queue ata hai to.

    • @Gaurav-vl6ym
      @Gaurav-vl6ym Місяць тому

      sir please teach more unique concepts like this one.

    • @Love-xs9mk
      @Love-xs9mk Місяць тому +1

      sir ,why not n^2log(n^2)

  • @harjotanand834
    @harjotanand834 Місяць тому +35

    Who's waiting for hard version 🔥🔥🔥🔥

  • @muntajir646
    @muntajir646 Місяць тому +9

    Your explanation is better than all other UA-camrs and leetcode editorial. Thanks🥰

  • @sauravchandra10
    @sauravchandra10 Місяць тому +3

    The second approach taught me a lot. I can't wait for the harder version of this problem!! Thanks a lot for these videos ❤

  • @harjotanand834
    @harjotanand834 Місяць тому +6

    Thanks for writing "Learn Something New " in thumbnail otherwise I was no going to open the video 😅😅

  • @kunalgambhir9157
    @kunalgambhir9157 Місяць тому +1

    14 minutes into the video and able to solve it own my own ,seriously men you have some next level teaching skill.

  • @shrasingh850
    @shrasingh850 Місяць тому +2

    Thank you for the valuable content and detailed C++ solutions! Your videos have been incredibly helpful for my learning journey.
    Could you also provide solutions for LeetCode contests or other problems in Java? It would be beneficial for those of us focusing on Java. Your insights are invaluable, and having them in Java would be a great addition.

  • @triumph9371
    @triumph9371 Місяць тому +1

    Thank you so much for this new thing. waiting for third approach for learning something more.

  • @AdityaMayukhSom
    @AdityaMayukhSom Місяць тому +1

    Great video, along with very good explanation. Please bring the hard solution too. Thank you.

  • @manasdeora4601
    @manasdeora4601 Місяць тому

    Bro, you have some serious teaching skills. Watched this twice and now the clarity of the heap solution is next level in my mind. So much, that I am able to code it in java by myself. Heartfelt thanks :)

  • @priyanshkumar17
    @priyanshkumar17 Місяць тому +3

    I was waiting for this bhaiya!! Thanks a lot

  • @gui-codes
    @gui-codes Місяць тому +2

    I am here to understand Heap approach. was waiting for your video mik
    Update - Loved the explanation. I was able to pause it and coded on my own. Please share PDF notes of 2nd Approach as it is something to keep a note of.

    • @priyanshkumar17
      @priyanshkumar17 Місяць тому

      I was also waiting for the video to get to know about heap approach cleanly...

    • @gui-codes
      @gui-codes Місяць тому

      @@priyanshkumar17 cool bro. mast samjhaya hai bhai ne

  • @ShrashtiYadav-me4xt
    @ShrashtiYadav-me4xt 16 днів тому +1

    plz make a video on optimized solution 🙏🙏🙏🙏............

  • @masoomyf
    @masoomyf Місяць тому +2

    i am waiting fort it... thanks

  • @user-bc1mp6rh1t
    @user-bc1mp6rh1t Місяць тому

    bhaiya your videos helps me alot. Please never stop this series. You are also a reason of my consistency.

  • @rev_krakken70
    @rev_krakken70 Місяць тому +1

    Hi @codestorywithMIK, in the discussion section, I also saw one approach involving sliding window with binary search. Will you be able to share that approach as well? Thanks

  • @wearevacationuncoverers
    @wearevacationuncoverers Місяць тому

    i submitted using brute force. it worked. now here to learn something new

  • @ce093_ojas4
    @ce093_ojas4 Місяць тому +3

    bhaiya pls contest ka 3rd question

  • @souravjoshi2293
    @souravjoshi2293 Місяць тому +2

    yesss, legend is here

  • @tharunkumar8133
    @tharunkumar8133 Місяць тому +1

    Excellent explanation. CFBR!

  • @ugcwithaddi
    @ugcwithaddi Місяць тому +2

    Finally wait is over

  • @aditikaushik3334
    @aditikaushik3334 Місяць тому

    can't wait for the 3rd approach

  • @user-cc4ne9yb1d
    @user-cc4ne9yb1d Місяць тому +1

    In approach-1,
    The nested loops are used so it's O(n^2) + for sorting O(NlogN) + for addition O(N).
    Hence the TC has to be O(N^2) right??
    why it's O(n^2 * log(n))????

    • @codestorywithMIK
      @codestorywithMIK  Місяць тому

      Please see my pinned comment.
      Size of temp will be of order n^2 because it contains sum of all possible subarrays .
      So sorting will take O(n^2 * log (n^2))
      Which can be written as
      O(n^2 * log(n))

  • @pranavgupta4810
    @pranavgupta4810 Місяць тому

    we can do it with deque too, right? following same approach-2, since the new subarray sum added will always be greatest

  • @RishabhChatterjee-fg2gz
    @RishabhChatterjee-fg2gz Місяць тому +1

    bhaiya hard version video please. new things we can learn

  • @gauravbanerjee2898
    @gauravbanerjee2898 Місяць тому

    Thanks a lot bhaiya ❤❤

  • @VineetDixit
    @VineetDixit Місяць тому +1

    god level approach

  • @SHIVAMOJHA21
    @SHIVAMOJHA21 Місяць тому

    first solution ka overall time complexity O(n*n) hai aur second wale ka , O((n*n)*(logn)), toh phir second approach use karke kya faeda??

  • @vm0305
    @vm0305 Місяць тому

    If feasible, please do cover the Binary Search and Sliding Window approach too, it was horrible in the editorial

  • @nehasinghggpl9637
    @nehasinghggpl9637 Місяць тому +1

    just wow
    awesome

  • @saihiteshreddy850
    @saihiteshreddy850 Місяць тому

    nice explanation dude

  • @swarajbuchude2474
    @swarajbuchude2474 Місяць тому +1

    explain the third approach from the editorial
    it is solved using binary search

  • @sakshamsharma4713
    @sakshamsharma4713 Місяць тому

    Can you make video on the binary search solution

  • @SHIVAMOJHA21
    @SHIVAMOJHA21 Місяць тому +1

    kya bawal technique ttha heap wala, RESPECT++
    PLEASE UPLOAD 3rd APPROACH

  • @nothingtolose682
    @nothingtolose682 Місяць тому

    in approach 1, why did we have do divide result by modulo? as I see constraints are less only....please explain

  • @Shivam-wl7fg
    @Shivam-wl7fg Місяць тому +2

    Whenever I Stuck in Any Coding Problem I Wish You Make Video On It. Really Great Explanation! 🫠

  • @yashbhambhani663
    @yashbhambhani663 Місяць тому

    I thought of priority queue approach myself before even opening the video but it tooke me a lot of time, how can i improve my speed?

  • @user-yn5ve8fl8e
    @user-yn5ve8fl8e Місяць тому

    Please make videos for leetcode contest solutions

  • @anshgupta8860
    @anshgupta8860 Місяць тому +1

    today i solved on my own😀

  • @neerajnagore
    @neerajnagore Місяць тому +1

    The silent killer at the beginning of Every DSA channel

  • @WithRk1512
    @WithRk1512 Місяць тому

    best explanation

  • @aizad786iqbal
    @aizad786iqbal Місяць тому

    waiting for the third approach,

  • @architagarwal7379
    @architagarwal7379 Місяць тому

    Binary search approach pe video ayegi kya bhai ??

  • @architagarwal7379
    @architagarwal7379 Місяць тому +1

    Sort humlog sab subarray sum ka kr rahe hai toh time complexity n^2*2logn hoga na bhai ?

  • @cosmicthor7330
    @cosmicthor7330 Місяць тому +1

    bhai aap kitna travel krtey ho saas leta hu to next trip aa jati hai apki

  • @devanshverma8050
    @devanshverma8050 Місяць тому

    Best solution by binary seach still exists, tho it's hard.

  • @prateekkumartripathi676
    @prateekkumartripathi676 Місяць тому +1

    bhai tum konse company me ho?? Great content btw

  • @khushvantkumar1670
    @khushvantkumar1670 Місяць тому

    bhai if possible try to make leetcode biweekly and weekly contest video..please?it will help us

    • @codestorywithMIK
      @codestorywithMIK  Місяць тому

      Yes i usually make them. But i was travelling this weekend and reached home late. Will try to make soon ❤️

  • @vinitjain7
    @vinitjain7 Місяць тому

    Sir prefix sum se kese kerna hai

  • @floatingpoint7629
    @floatingpoint7629 29 днів тому

    hard version kab upload hoga?

  • @k-CE-OmkarPathak
    @k-CE-OmkarPathak Місяць тому +1

    op sir

  • @nothingtolose682
    @nothingtolose682 Місяць тому

    please make hard version video sir

  • @user-pg2ce9jp6j
    @user-pg2ce9jp6j Місяць тому

    if the given array is not in sorted fashion then also this will work?

  • @rt_developer
    @rt_developer Місяць тому

    Waiting for hard version!

  • @aws_handles
    @aws_handles Місяць тому

    No fear. MIK is here

  • @manishgaming4638
    @manishgaming4638 Місяць тому

    Binary search kaise lagega?

  • @Hussain11Vlogs
    @Hussain11Vlogs Місяць тому

    bhai leetcode 409 ka D ka solution vedios please

  • @mileshsoni5016
    @mileshsoni5016 Місяць тому

    approach 3 jaldi daldo bhai

  • @fenilpatel6238
    @fenilpatel6238 Місяць тому

    POTD solve nahi ho raha approch -01 se bahut hi long array ke liye runtime error de raha hai

  • @Empire-jx5wk
    @Empire-jx5wk Місяць тому

    Make fast hard version

  • @EB-ot8uu
    @EB-ot8uu Місяць тому +1

    leetcode official solution and explanation is pathetic. I wonder what i would do if you didn't upload your explanations. thanks a lot sir for helping me in my learning journey

  • @vineetkumarmotwani474
    @vineetkumarmotwani474 Місяць тому

    Wait a sec how can we use this same approach to get subarray sums in decreasing order?

  • @VishalGupta-ft8df
    @VishalGupta-ft8df Місяць тому

    please solve leetcode 3225

  • @Abhay14
    @Abhay14 Місяць тому

    Bhai vaise second solution optimal to nhi h
    Dono solution ki both time and space complexity equal h