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