Skip to content

Commit

Permalink
add example
Browse files Browse the repository at this point in the history
  • Loading branch information
zehengl committed Sep 19, 2024
1 parent e80a485 commit 0e2bc53
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/fizzbuzz2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
n, m = [int(d) for d in input().split()]

c = []
for d in range(1, m + 1):
if d % 3 and d % 5:
c.append(str(d))
elif not d % 3 and d % 5:
c.append("fizz")
elif d % 3 and not d % 5:
c.append("buzz")
else:
c.append("fizzbuzz")

l = []
for _ in range(n):
l.append(sum(a == b for a, b in zip(input().split(), c)))
print(l.index(max(l)) + 1)

0 comments on commit 0e2bc53

Please sign in to comment.