-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathptice.py
35 lines (25 loc) · 823 Bytes
/
ptice.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
adrianSequence = "ABC" * 34
brunoSequence = "BABC" * 25
goranSequence = "CCAABB" * 17
N = int(input())
answers = input()
adrianScore = 0
brunoScore = 0
goranScore = 0
adrianSequence = adrianSequence[0:N]
brunoSequence = brunoSequence[0:N]
goranSequence = goranSequence[0:N]
for i in range(N):
if answers[i] == adrianSequence[i]:
adrianScore += 1
if answers[i] == brunoSequence[i]:
brunoScore += 1
if answers[i] == goranSequence[i]:
goranScore += 1
answerTracker = {"Adrian": adrianScore, "Bruno": brunoScore, "Goran": goranScore}
finalAnswer = {}
for key, value in sorted(answerTracker.items()):
finalAnswer.setdefault(value, []).append(key)
print(sorted(finalAnswer, reverse=True)[0])
for name in sorted(finalAnswer[sorted(finalAnswer, reverse=True)[0]]):
print(name)