Skip to content

Commit 03344e5

Browse files
authored
Solution
1 parent ce21cd4 commit 03344e5

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/bin/python3
2+
3+
import math
4+
import os
5+
import random
6+
import re
7+
import sys
8+
9+
# Complete the climbingLeaderboard function below.
10+
def climbingLeaderboard(scores, alice):
11+
scores = sorted(list(set(scores)))
12+
index = 0
13+
rank_list = []
14+
n = len(scores)
15+
for i in alice:
16+
while (n > index and i >= scores[index]):
17+
index += 1
18+
rank_list.append(n+1-index)
19+
return rank_list
20+
21+
22+
if __name__ == '__main__':
23+
fptr = open(os.environ['OUTPUT_PATH'], 'w')
24+
25+
scores_count = int(input())
26+
27+
scores = list(map(int, input().rstrip().split()))
28+
29+
alice_count = int(input())
30+
31+
alice = list(map(int, input().rstrip().split()))
32+
33+
result = climbingLeaderboard(scores, alice)
34+
35+
fptr.write('\n'.join(map(str, result)))
36+
fptr.write('\n')
37+
38+
fptr.close()

0 commit comments

Comments
 (0)