Skip to content

Commit 814a489

Browse files
committed
[level 1] Title: 두 정수 사이의 합, Time: 8.58 ms, Memory: 74.3 MB -BaekjoonHub
1 parent 1f38a9f commit 814a489

2 files changed

Lines changed: 16 additions & 3 deletions

File tree

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# [level 1] 두 정수 사이의 합 - 12912
22

3-
[문제 링크](https://school.programmers.co.kr/learn/courses/30/lessons/12912)
3+
[문제 링크](https://school.programmers.co.kr/learn/courses/30/lessons/12912?language=java)
44

55
### 성능 요약
66

7-
메모리: 10.3 MB, 시간: 0.29 ms
7+
메모리: 74.3 MB, 시간: 8.58 ms
88

99
### 구분
1010

@@ -16,7 +16,7 @@
1616

1717
### 제출 일자
1818

19-
2024년 06월 24일 19:50:40
19+
2026년 06월 18일 16:55:17
2020

2121
### 문제 설명
2222

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import java.math.*;
2+
3+
class Solution {
4+
public long solution(int a, int b) {
5+
long answer = 0;
6+
int c = Math.min(a, b);
7+
int d = Math.max(a, b);
8+
for (int i = c;i <= d; i++){
9+
answer += i;
10+
}
11+
return answer;
12+
}
13+
}

0 commit comments

Comments
 (0)