Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit e772068

Browse files
solves arranging coins
1 parent 0d28f47 commit e772068

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/ArrangingCoins.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
public class ArrangingCoins {
2+
public int arrangeCoins(int n) {
3+
return (int) Math.floor((Math.sqrt(8 * n + 1) - 1) / 2);
4+
}
5+
}

0 commit comments

Comments
 (0)