Task: | Sanalista |
Sender: | Lookas123 |
Submission time: | 2020-09-29 19:28:14 +0300 |
Language: | Node.js |
Status: | READY |
Result: | 100 |
group | verdict | score |
---|---|---|
#1 | ACCEPTED | 100 |
test | verdict | time | |
---|---|---|---|
#1 | ACCEPTED | 0.45 s | details |
#2 | ACCEPTED | 0.45 s | details |
#3 | ACCEPTED | 0.45 s | details |
Code
var readline = require('readline'); const r = readline.createInterface({ input: process.stdin, output: process.stdout, terminal: false }); function doubles(str){ let foundletters=[]; for(let i of str) { if(foundletters.includes(i)){ foundletters.splice(foundletters.indexOf(i),1); } else{ foundletters.push(i); } } return foundletters.length == 0 } let workinglines = 0; let currline = 0; let linecount = 0; r.on('line', function (line) { if(linecount == 0) { linecount = Number(line) } else{ workinglines += Number(doubles(String(line))); } currline++; if(currline == linecount+1) console.log(workinglines); });
Test details
Test 1
Verdict: ACCEPTED
input |
---|
1000 korvata sopimusaika nuhatartunta korttiautomaatti ... |
correct output |
---|
15 |
user output |
---|
15 |
Test 2
Verdict: ACCEPTED
input |
---|
1000 pub hansikaslokero erikoisvalmisteinen unijukka ... |
correct output |
---|
42 |
user output |
---|
42 |
Test 3
Verdict: ACCEPTED
input |
---|
1000 haapalastu toipumisaika mustalaiskieli taidelainaamo ... |
correct output |
---|
70 |
user output |
---|
70 |