Question DSA-TP-0050
MediumWhy can't a sliding window find the longest subarray with sum k when the array has negative numbers?
- A.
The array must be sorted
- B.
Shrinking the window no longer always decreases the sum, so the window can't be moved greedily
- C.
Sign up free to see the answer and a step-by-step explanation.