Skip to content

Commit e66984c

Browse files
committed
87차 2번 문제 풀이(푸는중)
1 parent 1a6884d commit e66984c

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

live8/test87/문제2/박희경.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
def solution(people, limit):
2+
answer = 0
3+
people.sort()
4+
5+
start, end = 0, len(people) - 1
6+
while start < end:
7+
mid = (start + end) // 2
8+
total = people[start] + people[mid]
9+
if total > limit:
10+
mid = end - 1
11+
else:
12+
mid = start + 1
13+
14+
return answer

0 commit comments

Comments
 (0)