Maximum Balanced Subsequence Sum solution leetcode

100112. Maximum Balanced Subsequence Sum User Accepted:0 User Tried:0 Total Accepted:0 Total Submissions:0 Difficulty:Hard 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 nums. A subsequence of an … Read more