aboutsummaryrefslogtreecommitdiff
path: root/challenge-127/abigail/python/ch-1.py
blob: 8e4bb3c3805d8d2a4e2e98e401e2923d0a1e44e3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/opt/local/bin/python

#
# See ../README.md
#

#
# Run as: python ch-1.py < input-file
#

import fileinput
import re

for line in fileinput . input ():
    seen = {}
    out  = 1
    for number in re . findall (r"[-+]?[0-9]+", line):
        if number in seen:
            out = 0
        seen [number] = 1
    print (out)