Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.

Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).

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.