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

Commit06747f9

Browse files
committed
202-happy-number.md Removed unrelated example.
1 parent32772f0 commit06747f9

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

‎zh/1-1000/202-happy-number.md

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,12 @@
2525
```
2626

2727
###[示例 2]
28-
**输入**:`k = 2, prices = [3,2,6,5,0,3]`
28+
**输入**:`n = 2`
2929

30-
**输出**:`7`
31-
32-
**解释**:
33-
```
34-
在第 2 天 (股票价格 = 2) 的时候买入,在第 3 天 (股票价格 = 6) 的时候卖出, 这笔交易所能获得利润 = 6-2 = 4 。
35-
随后,在第 5 天 (股票价格 = 0) 的时候买入,在第 6 天 (股票价格 = 3) 的时候卖出, 这笔交易所能获得利润 = 3-0 = 3 。
36-
```
30+
**输出**:`false`
3731

3832
###[约束]
39-
-`1 <= k <= 100`
40-
-`1 <= prices.length <= 1000`
41-
-`0 <= prices[i] <= 1000`
33+
-`1 <= n <= 2**31 - 1`
4234

4335
##思路
4436
1. 递归调用`isHappy(n)`比较方便,每次只需要生成新的`n`作为参数。

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp