2023 J3 - Special Event

Normalimplementation

1 Solution Available

Solution 1

PYTHON
1# By Daniel Zhang, Pinetree Secondary
2
3import sys
4
5n = int(input())
6
7people = []
8for i in range(n):
9    people.append(input())
10
11days = [0,0,0,0,0]
12for i in range(5):
13    c = 0
14    for p in people:
15        if p[i] == "Y":
16            c += 1
17    days[i] = c
18
19s = []
20
21m = max(days)
22for i in range(5):
23    if days[i] == m:
24        s.append(i+1)
25
26for n in range(len(s)):
27    if n == len(s)-1:
28        print(s[n])
29    else:
30        print(str(s[n]) + ",", end="")
31

Test Cases

Select a test case to view input and output