Leetcode doubts


862. Shortest Subarray with Sum at Least K
I am getting a wa .please explain why

Hi Somasree.
there is no need to make priority queue and all. u can simply do it using hashmap using the concept of sliding window.
Refer this https://ide.codingblocks.com/s/578593
Hope it clears all ur doubts

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.

Even your code is giving WA

sorry. i gave the ans of some other ques. give me 5 mins let me check ur code

i have corrected ur code.


it should work fine now

Can u please explain your corrections

I have mentioned them using comments

why is it??
// here it would be i+1 not i
also why
//here it would be i-p.second and not i+1