Click here to see the full article post
I found that if I changed double to long, then it is accepted........ brute force way!
For this sentence:
Further, for sum_i as the cumulative sum up to the current (i-th) index, all we need is sum_i - sum_j >= 0 such that j - i >= k.
Should it be sum_j - sum_i >= 0? Am I missing something here? Thanks in advance, appreciate the great write up!
@jwgoh You are right. I have corrected it. Thanks.
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.