Dsa
Arrays
Medium
Maximum Circular Subarray Sum
Given an array of integers representing an array of points related to a game, find the maximum sum of a subarray considering that the array is circular (meaning the end is connected to the start). You can assume there is at least one number in the array. Input consists of a single line with space-separated integers. Output should be a single integer, the maximum sum of the subarray.
Example:
Input: 1 -2 3 -2
Output: 3
Explanation: The subarray [3] has the maximum sum, and it's the valid maximum.
Key concepts
arrayssubarrayprefix-sumcircular
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