We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 38a6672 + d7b6f82 commit 9f7d8d9Copy full SHA for 9f7d8d9
0224LJH/202512/06 PGM 숫자의 표현.md
@@ -0,0 +1,29 @@
1
+```java
2
+import java.io.*;
3
+import java.util.*;
4
+
5
+class Solution {
6
+ public int solution(int n) {
7
+ int start = 1;
8
+ int end = 1;
9
+ int curSum = 1;
10
11
+ int answer = 0;
12
13
+ while (end <= n){
14
+ if (curSum == n){
15
+ answer++;
16
+ end++;
17
+ curSum += end;
18
+ }else if (curSum < n){
19
20
21
+ }else{
22
+ curSum -= start;
23
+ start++;
24
+ }
25
26
+ return answer;
27
28
+}
29
+```
0 commit comments