题目:
题解:
class Solution:
def arrangeCoins(self, n: int) -> int:
left, right = 1, n
while left < right:
mid = (left + right + 1) // 2
if mid * (mid + 1) <= 2 * n:
left = mid
else:
right = mid - 1
return left