Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

275
Vistas
How to omit duplicate consecutive chars in a string without using extra space?

I was asked this question by a big company. To my knowledge strings in JS are immutable. Hence, I can't do that. I was wondering if I am missing something. The interview was adamant not to create another var (string, array) and do it in-place.

input: 'harry'

output: 'hary'

I had to apologize and insist that I must create an array out of it and do the operations on it or create another empty string and push wanted chars to it.

Did I ruin my interview?

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda