Dsa
Two Pointers
Easy
Maximize Subarray Sum
Given an array of integers, find the maximum sum of a contiguous subarray with a length of at least two. Your program should read the array from stdin and print the maximum sum found.
Example:
Input:
-1 2 3 -2 5
Output:
8
Key concepts
two_pointersarrayssliding_window
Practise this out loud — free
Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.
🎙 Practise this question now