NeetCode #731LC-1911Medium2-D Dynamic Programming
← Back to All Problems

#731 · #1911 · Maximum Alternating Subsequence Sum(最大交替子序列和)

📌 Problem Statement & Constraints

Given an array nums, the alternating sum of a subsequence is the sum of its elements at even indices minus the sum of those at odd indices (0-indexed). Return the maximum alternating sum over all subsequences. Constraints: 1 <= nums.length <= 10^5, 1 <= nums[i] <= 10^5.
🔒

Sign In to Unlock Full Solutions for All 973 Problems

Sign in to access step-by-step logic, benchmark Python3 code, complexity breakdown, and offline export!