Available question text
Given a string s, compress it using regular characters and a special '*' character. The '*' acts as a macro that repeats the entire sequence generated up to that point exactly once (effectively doubling it). Find the shortest possible encoded string that decodes back to s using this rule. Example: s = "ABABCABABCE" → "AB*C*E" ("AB" → "ABAB" via '*' → "ABABC" → "ABABCABABC" via '*' → "ABABCABABCE").
Related questions
Continue with questions that share topics or the same question type.
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
Goldman Sachs
Shortest String Compression Using a Doubling Macro Character
Reported Sep 26, 2026 · 2 source reports
MID_LEVEL, SENIOR
Source snapshot: Nov 12, 2026
View source