Just a friendly heads up, neither the O(N) solution nor the O(N*K) solution works in a case where all the values are negative.
Hi @Brett,
Thanks for reaching out. The problem statement says that we are expecting only positive numbers in the input array:
Given an array of positive numbers and a positive number âkâ, find the maximum sum of any subarray of size âkâ .
Hope this clarifies your question.