Range Sum Query 2D | Leetcode

  Рет қаралды 11,657

Techdose

Techdose

Күн бұрын

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...

Пікірлер: 11
@t-m5678
@t-m5678 Жыл бұрын
thank you. your explanation has increased my understanding. I was stumped on this for several days. Now I understand.👍
@ashisranjandey7541
@ashisranjandey7541 Жыл бұрын
Great and correct explanation!!
@muditchoudhary28
@muditchoudhary28 Жыл бұрын
Thanks! great explanation
@JangBahadur3028
@JangBahadur3028 3 жыл бұрын
Lovely new logo
@techdose4u
@techdose4u 3 жыл бұрын
Thanks :)
@Ashborn-g1r
@Ashborn-g1r 9 ай бұрын
God Level Logic
@ksTales
@ksTales 3 жыл бұрын
Amazing explanation sir
@SunilSahu-li4cy
@SunilSahu-li4cy 2 жыл бұрын
Could you please make a video on Leetcode 847....
@techdose4u
@techdose4u 2 жыл бұрын
Will try for it
@monojit104
@monojit104 3 жыл бұрын
Could you please make video for Leetcode 2104?
@rajankhunt7002
@rajankhunt7002 2 жыл бұрын
Optimum location of point to minimize total distance [OR] Rasta and Kheshtak in SEARCH AND SORT if you make on video plz, plz, plz,
Range Sum Query 2D - Immutable - Leetcode 304 - Python
13:17
NeetCode
Рет қаралды 45 М.
#behindthescenes @CrissaJackson
0:11
Happy Kelli
Рет қаралды 27 МЛН
The Lost World: Living Room Edition
0:46
Daniel LaBelle
Рет қаралды 27 МЛН
Lesson 11: Check Multiple Links Quickly
4:12
gleb bahmutov
Рет қаралды 6
Sum Query in 2D Immutable Array Dynamic Programming
18:34
Tushar Roy - Coding Made Simple
Рет қаралды 51 М.
Sliding Window Technique - Algorithmic Mental Models
36:45
Ryan Schachte
Рет қаралды 374 М.
Maximum Employees to Be Invited to a Meeting | Leetcode 2127
52:53
What does it feel like to invent math?
15:08
3Blue1Brown
Рет қаралды 4,2 МЛН
Premature Optimization
12:39
CodeAesthetic
Рет қаралды 856 М.
How a Russian student invented a faster multiplication method
18:48
2D Prefix Sum and Submatrix Sum Queries
5:12
Profound Academy
Рет қаралды 8 М.
Car Pooling | Leetcode #1094
18:31
Techdose
Рет қаралды 11 М.
#behindthescenes @CrissaJackson
0:11
Happy Kelli
Рет қаралды 27 МЛН