Skip to content

Commit 669cf29

Browse files
committed
[level 2] Title: 구명보트, Time: 8.73 ms, Memory: 9.62 MB -BaekjoonHub
1 parent e65174b commit 669cf29

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

프로그래머스/2/42885. 구명보트/README.md

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

55
### 성능 요약
66

7-
메모리: 10.6 MB, 시간: 8.79 ms
7+
메모리: 9.62 MB, 시간: 8.73 ms
88

99
### 구분
1010

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

1717
### 제출 일자
1818

19-
2024년 08월 30일 01:02:47
19+
2025년 04월 25일 11:41:06
2020

2121
### 문제 설명
2222

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
def solution(people, limit):
2-
cnt = 0
32
people.sort()
4-
left, right = 0, len(people) - 1
3+
cnt, left, right = 0, 0, len(people)-1
54

65
while left <= right:
76
if people[left] + people[right] <= limit:
87
left += 1
98
right -= 1
109
cnt += 1
11-
1210
return cnt
1311

1412

0 commit comments

Comments
 (0)