I have an array of both positive and negative numbers. I want to the find the size of largest subarray whose sum is greater than or equal to the floor value of half the size of the subarray.
For e.g. in subarray 3 5 4 4 4 2 3 8 the largest subarray would be from first to the eight element and total length of subarray equal to 8. 33 >= 8/2
I wonder if there is any linear time solution to this problem
Comments
Post a Comment