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) +