Skip to content

Commit 97b8a7f

Browse files
committed
[level 1] Title: 두 정수 사이의 합, Time: 0.13 ms, Memory: 85.7 MB -BaekjoonHub
1 parent 0c2bdf8 commit 97b8a7f

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

프로그래머스/lv1/12912. 두 정수 사이의 합/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44

55
### 성능 요약
66

7-
메모리: 10.2 MB, 시간: 0.00 ms
7+
메모리: 85.7 MB, 시간: 0.13 ms
88

99
### 구분
1010

1111
코딩테스트 연습 > 연습문제
1212

1313
### 채점결과
1414

15-
Empty
15+
정확성: 100.0<br/>합계: 100.0 / 100.0
1616

1717
### 문제 설명
1818

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
class Solution {
2+
public long solution(int a, int b) {
3+
long answer = 0;
4+
if(a>b){
5+
for(int i=b; i<=a; i++){
6+
answer+=i;
7+
}
8+
}else{
9+
for(int i=a; i<=b;i++){
10+
answer+=i;
11+
}
12+
}
13+
return answer;
14+
}
15+
}

0 commit comments

Comments
 (0)