Leetcode 560. Subarray Sum Equals K

preview_player
Показать описание
Given an array of integers nums and an integer k, return the total number of continuous subarrays whose sum equals to k.



Example 1:

Input: nums = [1,1,1], k = 2
Output: 2
Example 2:

Input: nums = [1,2,3], k = 3
Output: 2

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

your explanation is awesome....keep making such videos

HARSHITSINGH-jfff
Автор

I was tired of going through so many videos to understand this question but this the only video that I found the most intuituve

adib
Автор

could you tell me how did you land to this logic?

tanayagogawale
Автор

You are the OG, Thnx for the Explanation

animeshbarole
Автор

Thank you Alisha, also make one video on how you had developed these kind of logic ...

tausifahmad
Автор

Every logic is of questions is very awesome can plz can you tell me how can I develope these logic self...

abhi_shek.-gupta
Автор

is there any benifit of keeping track of how many times an element occured?

hydrocy.
Автор

ma'am, I didn't get the intuition.

asifbasheerkhan
Автор

Why initially sum is having a count of 0 ???

poetryiscodingdecoding
Автор

Hi Alisha, just wanted to know can we solve this question by sliding window?

diveshrajput