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:

Meta


Question Timeline

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

Mid March, 2025

Meta

Mid-level

Late January, 2025

Meta

Mid-level

Mid September, 2024

Meta

Senior

Remove all adjacent duplicates in a string (Variation of LeetCode 1047)

Comments

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