Arranging coins

https://leetcode.com/problems/arranging-coins/

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