[LeetCode] Maximum Score of a Good Subarray

1 · · Feb. 11, 2022, 7:40 a.m.
1793. Maximum Score of a Good Subarray You are given an array of integers nums (0-indexed) and an integer k. The score of a subarray (i, j) is defined as min(nums[i], nums[i+1], …, nums[j]) * (j - i + 1). A good subarray is a subarray where i <= k <= j. Return the maximum possible score of a good subarray. ...