From cfe832a421ae69c391373d97e0fd07de0d280305 Mon Sep 17 00:00:00 2001 From: Lucas Santana Carneiro Date: Tue, 23 Oct 2018 15:09:02 -0300 Subject: [PATCH] =?UTF-8?q?Primeira=20recor=C3=AAncia?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/primeira_recorrencia/lucas_jkdrangel/index.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 src/primeira_recorrencia/lucas_jkdrangel/index.js diff --git a/src/primeira_recorrencia/lucas_jkdrangel/index.js b/src/primeira_recorrencia/lucas_jkdrangel/index.js new file mode 100644 index 0000000..e9ad34e --- /dev/null +++ b/src/primeira_recorrencia/lucas_jkdrangel/index.js @@ -0,0 +1,14 @@ +let array = [...Array(26)].fill(0) +let key = prompt('Entrada') +key = key.split('') +let test = false + +key.forEach(el => { + array[el.charCodeAt()-'A'.charCodeAt()]+=1 + if(array[el.charCodeAt()-'A'.charCodeAt()]>1 && !test){ + console.log(el); + test = true + } +}); +if(!test) console.log(null) +