Company: Inmobi_4nov
Difficulty: medium
Eldon's Stones Problem Description Eldon is a mountain explorer who loves to collect rare stones hidden along a long ridge trail. The trail consists of a series of marked spots, each labelled from 0 to n - 1 . At each spot, there's a unique stone with a certain value, denoted by an array stones[i] is the value of the stone at spot i . Eldon wants to collect a sequence of stones from some of these spots, not necessarily consecutive, but he has one strict rule: If he picks a stone from a higher spot after picking one from a lower spot, the increase in value must be at least as much as the number of steps taken between the two spots. Formally, if Eldon picks stones at indices i_0 < i_1 < ... < i_k-1 , then the sequence is valid if it satisfies: stones[i_j] - stones[i_j-1] >= i_j - i_j-1 , for every j in [1, k-1] . Even a single stone is considered a valid sequence. Eldon wants to maximize the total value of the stones he collects in such a valid subsequence. Find the maximum v