Skip to content

Commit 7cd56f7

Browse files
author
guoshufeng
committed
gsf
1 parent 42a3759 commit 7cd56f7

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

Week_01/id_30/LeetCode_441_30.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
package com.shufeng.algorithm.d0_;
22

3-
import com.shufeng.algorithm.dto.ListNode;
4-
53
/**
64
* @author gsf
75
*/
@@ -21,7 +19,7 @@ public static int arrangeCoins(int n) {
2119
// 二分法查询硬币可以摆放的行数
2220
long mid = low + (high - low) / 2;
2321
// 核心公式 放满n行用的硬币数:n*(n+1)/2
24-
// 如果给的硬币数大于mid,证明比这行多去右面去找行数,如果小去左边找行数
22+
// 如果给的硬币数大于n,证明比这行多去右面去找行数,如果小去左边找行数
2523
if (mid * (mid + 1) / 2 <= n) {
2624
low = mid + 1;
2725
} else {

0 commit comments

Comments
 (0)