2015: d01: ex1: add solution

This commit is contained in:
Bruno BELANYI 2025-05-21 00:39:38 +01:00
parent 086fef2122
commit 380b527017

18
2015/d01/ex1/ex1.py Executable file
View file

@ -0,0 +1,18 @@
#!/usr/bin/env python
import collections
import sys
def solve(input: str) -> int:
directions = collections.Counter(input.strip())
return directions["("] - directions[")"]
def main() -> None:
input = sys.stdin.read()
print(solve(input))
if __name__ == "__main__":
main()