interview-challenges icon indicating copy to clipboard operation
interview-challenges copied to clipboard

Update README.md

Open joseangelcrn opened this issue 5 months ago • 0 comments

if I understood the isograma´s logic 'reto' should return 'true', no?

//ISOGRAMAS (JavaScript)

const isograma = (palabras) => {
  let diccionario = new Map();
  
  //string vacio
  if(palabras.trim().length === 0){
    return true;
  }
  
  for(let i=0; i< palabras.length; i++){
    let letra = palabras.charAt(i);
    
    if(diccionario.has(letra)){
      return false;
    }else{
      diccionario.set(letra,1)
    }
  }
  
  
  return true;
}

isograma('reto')

joseangelcrn avatar Aug 30 '25 23:08 joseangelcrn