Skip to content

Instantly share code, notes, and snippets.

@Daksh
Created August 7, 2020 19:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Daksh/871996dd057790ec9ed9dfbc5679ebea to your computer and use it in GitHub Desktop.
Save Daksh/871996dd057790ec9ed9dfbc5679ebea to your computer and use it in GitHub Desktop.
Arranging Coins
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