C++ | Leetcode C++题解之第441题排列硬币
题目:
题解:
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);
}
};