← Goldman Sachs questions
CodingMediumReported in a candidate post, Jul 2025

Reduce a string by removing k consecutive identical characters

Filed under Goldman Sachs

Given a string s and an integer k, repeatedly remove groups of k adjacent identical characters, joining the remaining parts together, until no more removals are possible. Return the final string.

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 Goldman Sachs questions

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