Skip to content

Commit 4a1dd1c

Browse files
author
Gonzalo Diaz
committed
[REFACTOR] [Hacker Rank] Interview Preparation Kit: Greedy Algorithms: Luck Balance. Type hinting added.
1 parent 9cc1246 commit 4a1dd1c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/hackerrank/interview_preparation_kit/greedy_algorithms/luck_balance.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,9 @@ def luck_balance(k, contests: list) -> int:
3434
key=lambda contest: (-contest['important'], -contest['luck'])
3535
)
3636

37-
total = 0
38-
size = len(important_competitions)
37+
total: int = 0
38+
size: int = len(important_competitions)
39+
3940
for i in range(0, min(k, size)):
4041
total += important_competitions[i].luck
4142

0 commit comments

Comments
 (0)