Coding Challenge · ADVANCED
Given an array popularity of n stages, where popularityi is the popularity score of the i-th stage, select a subset of stages to maximize the total popularity, subject to the following constraint: For any two chosen stages at indices i and j (with i < j), the number of stages skipped between them (j - i - 1) must be at…