Longest Sub-Array with Sum K
Problem Statement
Input :
A[] = {10, 5, 2, 7, 1, 9}
K = 15
Output : 4
Explanation:
The sub-array is {5, 2, 7, 1}.Input :
A[] = {-1, 2, 3}
K = 6
Output : 0
Explanation:
There is no such sub-array with sum 6.Intuition
Links
Video Links
Approach 1:
Approach 2:
Approach 3:
Approach 4:
Similar Problems
Last updated