Search
⌘K

Leetcode 1047. Remove All Adjacent Duplicates In String

Given a lowercase string, repeatedly remove any two equal adjacent characters until no more removals are possible and return the resulting (unique) string. Solve in linear time using a stack or in-place two-pointer simulation to handle lengths up to 1e5.

Asked at:

Goldman Sachs

Meta


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Late February, 2026

Goldman Sachs

Mid-level

Use stack. Very straightforward.

Mid March, 2025

Meta

Mid-level

Late January, 2025

Meta

Mid-level

Your account is free and you can post anonymously if you choose.