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


Runtime: 8 ms, faster than 45.21% of Go online submissions for Arranging Coins.
Memory Usage: 2.2 MB, less than 24.66% of Go online submissions for Arranging Coins.


```go
func arrangeCoins(n int) int {
    //7:29
    i := 0
    level := 0
    for true {
        i += level + 1
        level += 1
        if i==n {
            return level
        } else if i > n {
            return level - 1
        }
    }
    return 0
    //7:30
}
```
