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




Runtime: 8 ms, faster than 45.31% of C++ online submissions for Arranging Coins.
Memory Usage: 5.8 MB, less than 96.03% of C++ online submissions for Arranging Coins.



```
class Solution {
public:
    int arrangeCoins(int n) {
        //7:37
        long int i = 0;
        long int level = 0;
        while (true) {
            i += level + 1;
            level += 1;
            if (i == n) {
                return level;
            } else if (i > n) {
                return level - 1;
            }
        }
        return 0;
        //7:37
    }
};
```
