Range Sum Query 2D - Immutable - Leetcode 304 - Python

preview_player
Показать описание


0:00 - Read the problem
1:15 - Drawing Explanation
7:31 - Coding Explanation

leetcode 304

#coding #interview #python
Disclosure: Some of the links above may be affiliate links, from which I may earn a small commission.
Рекомендации по теме
Комментарии
Автор

Thank you Neet. This concept is a bit difficult to explain but you did a good job!

blossombabalola
Автор

At first, it was a little tough to understand, but I watched this video multiple times. Now I fully understood the concept! thanks Neetcode!

mohammedafzal
Автор

To be honest at the start I thought I was completely off the mark, but that's exactly how I solved it, thanks for the video.

MadK
Автор

My first time hearing about prefix sum but this made it easier to understand

kariuki
Автор

I understand why we are adding a top row since it would be out of bounds when we are calculating prefix sum for the first row (no "above"), but why are we also adding a left column?

SkyeTian
Автор

Really liking the strategy of posting videos on the streak day!!

aishwaryaranghar
Автор

Hey Neet! You explain great! I love your videos. Can you make a video about Problem 307. Range Sum Query - Mutable?
It uses Segment Trees to optimize the algorithm. Would love to see that!

dabobrotosarkar
Автор

This can be generalized to all shapes with vertical or horizontal edges... Then we can apply inclusion exclusion principle

jasdeepsinghgrover
Автор

thank you so much sir, took me 3 hours to understand it

hinatahyuga
Автор

Thank You for such a wonderful explanation....

krishnalath
Автор

It would be great video. I am jumping on this r8 now. Cheers!

programmermainul
Автор

I don't know what will i do. I can't think of anything while solving these problems

spyboy
Автор

Thank you! You are a master at explaining!

ainazikmomunalieva
Автор

What's the logic behind calculating prefix sum for each cell? What's the intuition behind the formula you used?

DK-oxze
Автор

Line 10 : above = matrix[i][j+1]
How is this above it should be right ?

reapergrim
Автор

cant we compute the prefix matrix in place of the given matrix ?

pulakammalathy
Автор

one-liner:
The time limit is exceeding, Why?
return for i in range(row1, row2+1)])
Can you explain?

rajsuriyang
Автор

Sir, will you please solve leetcode 174?

Nisha.......
Автор

Great video. Mind helping with similar video on Range sum mutable 308 which has update func. Would be great to understand Index tree implementations.

theghostwhowalk
Автор

I would honestly never ask this in an interview. Kinda feels like you either have seen the problem and know the answer, or need to take significant amount of time deriving it. Tells you nothing about the candidate, except whether or not they do alot of leet code.

robertlemiesz