Skip to content

Commit 408ffef

Browse files
committed
[level 1] Title: 체육복, Time: 0.02 ms, Memory: 9.29 MB -BaekjoonHub
1 parent afa172a commit 408ffef

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

프로그래머스/1/42862. 체육복/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 MB, 시간: 0.01 ms
7+
메모리: 9.29 MB, 시간: 0.02 ms
88

99
### 구분
1010

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

1717
### 제출 일자
1818

19-
2024년 08월 04일 20:49:00
19+
2025년 04월 21일 13:41:49
2020

2121
### 문제 설명
2222

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,16 @@
11
def solution(n, lost, reserve):
2-
# 정렬
32
lost.sort()
43
reserve.sort()
5-
6-
# lost, reserve에 공통으로 있는 요소 제거
4+
75
for i in reserve[:]:
86
if i in lost:
97
reserve.remove(i)
108
lost.remove(i)
11-
12-
# 체육복 빌려주기(나의 앞 번호부터 확인)
9+
1310
for i in reserve:
1411
if i-1 in lost:
1512
lost.remove(i-1)
1613
elif i+1 in lost:
1714
lost.remove(i+1)
18-
19-
return n-len(lost)
15+
16+
return n - len(lost)

0 commit comments

Comments
 (0)