Skip to content

Commit d986cd8

Browse files
committed
[PGS] 숫자 게임 / Level3 / 10분
1 parent 43c2d3f commit d986cd8

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
def solution(A, B):
2+
answer = 0
3+
A.sort(); B.sort()
4+
lenA, lenB = len(A), len(B)
5+
Ap, Bp = 0, 0
6+
7+
while Bp < lenB and Ap < lenA:
8+
if A[Ap] < B[Bp]:
9+
answer += 1
10+
Ap += 1
11+
Bp += 1
12+
elif A[Ap] == B[Bp]:
13+
#Ap += 1
14+
Bp += 1
15+
elif A[Ap] > B[Bp]:
16+
Bp += 1
17+
print(answer)
18+
return answer

0 commit comments

Comments
 (0)