题目:
题解:
java
class Solution {
public int arrangeCoins(int n) {
return (int) ((Math.sqrt((long) 8 * n + 1) - 1) / 2);
}
}
题目:
题解:
class Solution {
public int arrangeCoins(int n) {
return (int) ((Math.sqrt((long) 8 * n + 1) - 1) / 2);
}
}