class Solution:
"""
@param n: a non-negative integer
@return: the total number of full staircase rows that can be formed
"""
'''
大致思路:
1.首先阶梯行数是按照1,2,3,4...的顺序进行排放的,那么可以初始化s = 0,whiletrue,s = s + i,直到s大于n
的时候,返回s - n,即可.
'''
def arrangeCoins(self,n):
s = 0
i = 0while True:
if s > n:
return i - 1
i += 1
s += i