Longest Subarray With Sum K
Medium
Prefix Sums with Hash Maps
Print the length of the longest contiguous subarray whose sum equals k, or 0 if none.
Constraints
1 <= n <= 10^5
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.