aboutsummaryrefslogtreecommitdiff
path: root/challenge-127/abigail/node/ch-1.js
blob: 931330be8bea0a72bba3b61e41c679c94e97fdd2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/local/bin/node

//
// See ../README.md
//

//
// Run as: node ch-1.js < input-file
//

  require ('readline')
. createInterface ({input: process . stdin})   
. on              ('line', line => {
    let seen = {}
    let out  = 1
    line . split (/[ ;]+/) . forEach (n => {
        if (n in seen) {
            out = 0
        }
        seen [n] = 1
    })
    console . log (out)
})