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



Runtime: 104 ms, faster than 82.61% of TypeScript online submissions for Arranging Coins.
Memory Usage: 40.4 MB, less than 86.96% of TypeScript online submissions for Arranging Coins.



```
function arrangeCoins(n: number): number {
    //7:33
    let i = 0
    let level = 0
    while (true) {
        i += level + 1
        level += 1
        if (i == n) {
            return level
        } else if (i > n) {
            return level - 1
        }
    }
    return 0
    //7:34
};
```
