← FactSet questions

Eliminate consecutive duplicate characters

Filed under FactSet

Given a string, repeatedly eliminate pairs of adjacent identical characters until no more such pairs exist. For example, 'axxbyybc' becomes 'abyybc', then 'abc', then 'ac'.

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related FactSet questions

Collected from public candidate posts and coding forums. Updated Nov 2026.