Range Sum Query 2D | Leetcode

Sdílet
Vložit
  • čas přidán 7. 09. 2024
  • This video explains a very important programming interview problem based on 2d matrix which is finding range sum on a 2D matrix. If this problem was on 1D array then we could have applied prefix sum or segment tree if updates were allowed. In this case, we don't have updates, so 2D prefix sum array can be built to solve the problem. This will take order of number of rows or columns time depending on how we build prefix sum array. The best approach however just does preprocessing once and we can solve each query in O(1) constant time. I have explained all the approaches one by one to solve the problem along with intuition and examples.
    CODE LINK is present below as usual. If you find any difficulty or have any query then do COMMENT below. PLEASE help our channel by SUBSCRIBING and LIKE our video if you found it helpful...CYA :)
    ======================================PLEASE DONATE=============================
    🧡 SUPPORT OUR WORK: / techdose
    💚 UPI-ID: surya.kahar@ybl
    💞JOIN Membership: / @techdose4u
    ==============================================================================
    INSTAGRAM : / surya.pratap.k
    LinkedIn: / surya-pratap-kahar-47b...
    WEBSITE: techdose.co.in/
    TELEGRAM Channel LINK: t.me/codewithT...
    TELEGRAM Group LINK: t.me/joinchat/...
    =======================================================================
    USEFUL LINKS:
    🟠Must do TIPS to ACE Virtual Interview: • 🔴Must do Tips to ACE y...
    🟢Best strategy to excel your coding interview: • 🔴Best strategy to exce...
    🟡Get your dream job in 1 month: • 🔴Get your dream job in...
    🔵How to crack dream job in just 2 months: • How to crack dream job...
    🟣7 Days DSA plan: techdose.co.in...
    RELATED LINKS:
    CODE LINK: gist.github.co...

Komentáře • 11

  • @t-m5678
    @t-m5678 Před 7 měsíci +1

    thank you. your explanation has increased my understanding. I was stumped on this for several days. Now I understand.👍

  • @JangBahadur3028
    @JangBahadur3028 Před 2 lety +4

    Lovely new logo

  • @ashisranjandey7541
    @ashisranjandey7541 Před 9 měsíci

    Great and correct explanation!!

  • @muditchoudhary28
    @muditchoudhary28 Před 10 měsíci

    Thanks! great explanation

  • @user-hm4vc9dp1t
    @user-hm4vc9dp1t Před 4 měsíci

    God Level Logic

  • @ksTales
    @ksTales Před 2 lety

    Amazing explanation sir

  • @SunilSahu-li4cy
    @SunilSahu-li4cy Před 2 lety +1

    Could you please make a video on Leetcode 847....

  • @rajankhunt7002
    @rajankhunt7002 Před 2 lety

    Optimum location of point to minimize total distance [OR] Rasta and Kheshtak in SEARCH AND SORT if you make on video plz, plz, plz,

  • @monojit104
    @monojit104 Před 2 lety

    Could you please make video for Leetcode 2104?