441. 排列硬币





class Solution(object):
    def arrangeCoins(self, n):
        """
        :type n: int
        :rtype: int
        """
        return int(2 ** 0.5 * (n + 1 / 8) ** 0.5 - 1 / 2)

if __name__ == '__main__':
    solution = Solution()
    print(solution.arrangeCoins(5))
原文地址:https://www.cnblogs.com/panweiwei/p/13065253.html