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

Commit 218f62a

Browse files
✨feat: Add 908
1 parent 93693e3 commit 218f62a

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

‎LeetCode/901-910/908. 最小差值 I(简单).md‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,6 @@ Tag : 「模拟」、「脑筋急转弯」
4848

4949
### 脑筋急转弯
5050

51-
今天胃不是很舒服,来晚了。
52-
5351
根据题意,对于任意一个数 $nums[i]$ 而言,其所能变化的范围为 $[nums[i] - k, nums[i] + k],ドル我们需要最小化变化后的差值。而当 $k$ 足够大时,我们必然能够将所有数变为同一个值,此时答案为 0ドル,ドル而更一般的情况,我们能够缩减的数值距离为 2ドル * k,ドル因此如果原来的最大差值为 $d = \max - \min,ドル若 $d <= 2 * k$ 时,答案为 0ドル,ドル否则答案为 $d - 2 * k$。
5452

5553
代码:

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /