CSES - Datatähti 2021 alku - Results
Submission details
Task:Sanalista
Sender:Lookas123
Submission time:2020-09-29 19:28:14 +0300
Language:Node.js
Status:READY
Result:100
Feedback
groupverdictscore
#1ACCEPTED100
Test results
testverdicttime
#1ACCEPTED0.45 sdetails
#2ACCEPTED0.45 sdetails
#3ACCEPTED0.45 sdetails

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