[PROBLEM] 1793. Maximum Score of a Good Subarray #164
Labels
dificulty: hard
Hard difficulty problem.
hacktoberfest
Hacktoberfest issue.
problem
LeetCode problem.
Difficulty
Hard
Problem Description
You are given an array of integers
nums
(0-indexed) and an integerk
.The score of a subarray
(i, j)
is defined asmin(nums[i], nums[i+1], ..., nums[j]) * (j - i + 1)
. A good subarray is a subarray wherei <= k <= j
.Return the maximum possible score of a good subarray.
Example 1:
Example 2:
Constraints:
1 <= nums.length <= 105
1 <= nums[i] <= 2 * 104
0 <= k < nums.length
Link
https://leetcode.com/problems/maximum-score-of-a-good-subarray/
The text was updated successfully, but these errors were encountered: