subarray sum equals k leetcode | subarray sum equal to k python | amazon interview question

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


Please like the video, this really motivates us to make more such videos and helps us to grow. thecodingworld is a community which is formed to help fellow student and professionals looking to crack the “coding interviews”.

We love solving and sharing problems which are frequently asked in technical interviews and voted by community at various websites.

✅ For more and upcoming updates join our community

#leetcode #python
Рекомендации по теме
Комментарии
Автор

You did a better job at explaining than NeetCode did for this question. Well done.

SmoothCode
Автор

rather than explaining what you did, u must explain " why u did that". because we don't get the intuition or the idea behind it.

amoghmulge
Автор

Thank you ! I like the way you take the time, to first, explain the approach, before you begin coding.

annjames
Автор

seen so many other videos on the same problem, but the explanation that u give is exemplary, loved the explanation

kumarshivam
Автор

By far the best approach and well explained

appcolab
Автор

best explanation of this problem I've come across with. Thank you! A lot of the other videos doesn't explain count += map.get(sum-k) part very well. But this is gold!

davidpaolochua
Автор

dude ur so smart... and ur explanation is so clear its like ASMR

kingjohnkk
Автор

You are awesome. Struggled hella. Finally understood this algo.

petrob
Автор

in line 15, why we are adding comulative sum to the dictonary by intial value 1 ? it could be any next indexed value

TheArbaaz-rntq
Автор

you should increase value of the key only when the key shows up again in prefix sum array, but you are also increasing the value when the key shows up as diff here

cgqqqq
Автор

Thank you so much, was breaking my head with neetcode

Shruthi_
Автор

thank you, that's a really nice solution! How can one build such intuition to apply math operations and think outside the box, rather than getting stuck at the layman approach of n*n time complexity?

aditya
Автор

Thank you! Very easy to understand the explanation!

shen-yusun
Автор

Thanks for providing a solution to this problem. I have liked and subscribed. I hope that motivates you guys to do more.

nwokolobueze
Автор

Hi very nice explanation. Also which software do you use for drawing on screen.

reemachourey
Автор

Thanks for the explanation! I was having a hard time understanding it for a while but it's clear now!

praison
Автор

multidimensionality approach in your videos for answers is really good..

mayankrathi
Автор

we don't really need to put {0:1} in hashmap initially, wen cumulative sum become 7, it would take care of {0:1}.
great explanation though!!

MayankSingh_is_me
Автор

When I changed the sequence of if statements, it gave me an error. Why? Aren't they parallel?

jasonteng
Автор

Will you please explain why you get count equals 6? Your input to yield count = 4 not 6

ployapinon