Available question text
Find the contiguous subarray that maximizes the alternating sum formed by adding and subtracting consecutive elements (a[i] - a[i+1] + a[i+2] - ...). The core challenge is an O(n) Kadane-like/two-state DP to track the best ending sums when the next element is added or subtracted.
Related questions
Continue with questions that share topics or the same question type.
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
No company association
Leetcode 2036. Maximum Alternating Subarray Sum
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source