1300. Sum of Mutated Array Closest to Target
https://leetcode.com/problems/sum-of-mutated-array-closest-to-target
Description
Given an integer array arr
and a target value target
, return the integer value
such that when we change all the integers larger than value
in the given array to be equal to value
, the sum of the array gets as close as possible (in absolute difference) to target
.
In case of a tie, return the minimum such integer.
Notice that the answer is not neccesarilly a number from arr
.
Example 1:
Example 2:
Example 3:
Constraints:
1 <= arr.length <= 104
1 <= arr[i], target <= 105
ac
Previous1299. Replace Elements with Greatest Element on Right SideNext1301. Number of Paths with Max Score
Last updated