← All problemsSign in

2926. Maximum Balanced Subsequence Sum

LeetCodeArrayBinary SearchDynamic ProgrammingBinary Indexed TreeSegment TreeOpen on judge ↗

You are given a 0-indexed integer array nums. A subsequence of nums having length k and consisting of indices i0 < i1 < ... < ik-1 is balanced if the following holds: - nums[ij] - nums[ij-1] >= ij - ij-1, for every j in the range [1, k - 1]. A subsequence of nums having length 1 is considered balanced. Return an integer denoting the maximum possible sum of elements in a balanced subsequence of

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start