You are given an array of integers `nums` and a specified range defined by `left` and `right` indices. Find the maximum amplitude within this range, where amplitude is the difference between the maximum and minimum values in the subarray.
Explanation: The subarray from index 1 to 3 is [2, 3, 4], with max 4 and min 2, giving an amplitude of 4 - 2 = 2.
Analyze constraints and compute optimal solutions step-by-step.
No dry run loaded.
🚀 Practice this problem
Run code, get AI hints & track streak