Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb1c02d8

Browse files
refactor 1300
1 parentb534b6b commitb1c02d8

File tree

1 file changed

+0
-21
lines changed

1 file changed

+0
-21
lines changed

‎src/main/java/com/fishercoder/solutions/_1300.java

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,5 @@
11
packagecom.fishercoder.solutions;
22

3-
/**
4-
* 1300. Sum of Mutated Array Closest to Target
5-
*
6-
* 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,
7-
* the sum of the array gets as close as possible (in absolute difference) to target.
8-
* In case of a tie, return the minimum such integer.
9-
* Notice that the answer is not neccesarilly a number from arr.
10-
*
11-
* Example 1:
12-
* Input: arr = [4,9,3], target = 10
13-
* Output: 3
14-
* Explanation: When using 3 arr converts to [3, 3, 3] which sums 9 and that's the optimal answer.
15-
*
16-
* Example 2:
17-
* Input: arr = [2,3,5], target = 10
18-
* Output: 5
19-
*
20-
* Example 3:
21-
* Input: arr = [60864,25176,27249,21296,20204], target = 56803
22-
* Output: 11361
23-
* */
243
publicclass_1300 {
254
publicstaticclassSolution1 {
265
publicintfindBestValue(int[]arr,inttarget) {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp