Skip to content

Commit e31c762

Browse files
committed
Solved high-scores challenge
1 parent 98a5f3a commit e31c762

File tree

2 files changed

+1
-9
lines changed

2 files changed

+1
-9
lines changed

high-scores/high_scores.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
import numpy as np
2-
3-
4-
51
def latest(scores):
62
for i in scores:
73
if (i == 30):
@@ -12,12 +8,8 @@ def personal_best(scores):
128
for i in scores:
139
if (i == 100):
1410
return i
15-
1611
pass
1712

1813
def personal_top_three(scores):
19-
top_3_idx = np.argsort(scores)[-3:]
20-
top_3_values = [scores[i] for i in top_3_idx]
21-
return top_3_values
22-
14+
return sorted(scores, reverse=True)[:3]
2315
pass

high-scores/high_scores.pyc

83 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)