File tree Expand file tree Collapse file tree 1 file changed +0
-32
lines changed
src/main/java/com/fishercoder/solutions Expand file tree Collapse file tree 1 file changed +0
-32
lines changed Original file line number Diff line number Diff line change 1
1
package com .fishercoder .solutions ;
2
2
3
- /**
4
- * 441. Arranging Coins
5
- *
6
- * You have a total of n coins that you want to form in a staircase shape, where every k-th row must have exactly k coins.
7
-
8
- Given n, find the total number of full staircase rows that can be formed.
9
-
10
- n is a non-negative integer and fits within the range of a 32-bit signed integer.
11
-
12
- Example 1:
13
-
14
- n = 5
15
-
16
- The coins can form the following rows:
17
- ¤
18
- ¤ ¤
19
- ¤ ¤
20
-
21
- Because the 3rd row is incomplete, we return 2.
22
-
23
-
24
- Example 2:
25
-
26
- n = 8
27
-
28
- The coins can form the following rows:
29
- ¤
30
- ¤ ¤
31
- ¤ ¤ ¤
32
- ¤ ¤
33
-
34
- Because the 4th row is incomplete, we return 3.*/
35
3
public class _441 {
36
4
37
5
public static class Solution1 {
You can’t perform that action at this time.
0 commit comments