The idea is to find the rule of the samples.

```
class Solution(object):
def arrangeCoins(self, n):
"""
:type n: int
:rtype: int
"""
i=1
if n==1:return 1
while(n>=i):
n=n-i
i+=1
return (i-1)
```