Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

273
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!