A recent race to conquer the “no-three-in-a-line” problem shows just how far away mathematicians are from a full solution ...
Try all possible subarrays using nested loops; whichever is the max is the solution. Let’s first understand why the obvious approaches don’t work. We absolutely can use prefix sums to solve this ...