Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.039 s | 7 KBi |
#2 |
Correcto
|
0.029 s | 6 KBi |
#3 |
Correcto
|
0.071 s | 33 KBi |
#4 |
Correcto
|
0.02 s | 6 KBi |
#5 |
Correcto
|
0.02 s | 7 KBi |
#6 |
Correcto
|
0.025 s | 6 KBi |
#7 |
Correcto
|
0.025 s | 7 KBi |
#8 |
Correcto
|
0.063 s | 19 KBi |
#9 |
Correcto
|
0.023 s | 6 KBi |
#10 |
Correcto
|
0.023 s | 6 KBi |
#11 |
Correcto
|
0.024 s | 6 KBi |
#12 |
Correcto
|
0.024 s | 6 KBi |
let readline = require("readline"); let LetterLog = []; process.stdin.setEncoding("utf8"); let stdin = readline.createInterface({ input: process.stdin, terminal: false, }); stdin.on("line", readLine); function readLine(line) { let wordLetters = [...line]; let wordLength = wordLetters.length; for (let letter = 0; letter < wordLength; letter++) { let currentLetter = wordLetters[letter] let isIncluded = LetterLog.includes(currentLetter) if (isIncluded) { return console.log("yes"); } if (letter === wordLength - 1) { console.log("no"); } else { LetterLog.push(currentLetter) } } }