Created
August 7, 2020 19:45
-
-
Save Daksh/871996dd057790ec9ed9dfbc5679ebea to your computer and use it in GitHub Desktop.
Arranging Coins
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Solution: | |
def arrangeCoins(self, n: int) -> int: | |
i = 1 | |
while i*(i+1)/2<=n: | |
i+=1 | |
return i-1 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment