Company: NXT wave_18oct
Difficulty: medium
Dynamic Range Scoring in a Modified Array Problem Description Given an array of positive integers nums (0-indexed) and an integer k , your task is to calculate the maximum score from a dynamically modified subarray that must include the element k . Dynamic Scoring Mechanism: The score of a subarray (i, j) is defined as the product of the dynamic minimum of nums[i] through nums[j] and the cumulative sum of a secondary array scores , which is initially all zeros and has the same length as nums . The dynamic minimum is the smallest value in the current subarray after applying all modifications up to that point. At each step, you may perform one of the following operations, up to a maximum of M times on the subarray (i, j) : i. Increment: Increase the value of one element in the subarray by 1. ii. Decrement: Decrease the value of one element in the subarray by 1, but not below 1. iii. Score Update: For each operation, update the scores array at the position of the modified element by 1. Yo