Skip to content

Commit 81695e7

Browse files
committed
87차 2번 문제풀이
1 parent 70a1245 commit 81695e7

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

live8/test87/문제2/백유진.py

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

0 commit comments

Comments
 (0)