2023-07-23 17:03:43 +0000 UTC

Arranging Coins

Code

class Solution:
    def arrangeCoins(self, n: int) -> int:
        count = 0
        row = 1
        while n >= row:
            n -= row
            row += 1
            count += 1

        return count