Shortest Result After Candy Crush Removals
Updated
Problem statement
In one move, remove any maximal contiguous run of at least three equal characters. The remaining parts collide and may create new removable runs.
Return the shortest stable string reachable by choosing removal order optimally. Break equal-length ties lexicographically.
Function
shortestCandyCrush(text: String) → StringExamples
Example 1
text = "aaabbbacd"return = "cd"Removing bbb first creates aaaa, which is then removed.
Constraints
0 <= text.length <= 20.- The text contains lowercase English letters.
More Bloomberg LP Phone Screen questions
- Pascal's TrianglePHONE SCREEN · ONSITE INTERVIEW · Seen Dec 2026
- Valid Triangle NumberPHONE SCREEN · ONSITE INTERVIEW · Seen Dec 2026
- Collatz Conjecture with Shared MemoizationPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
- Word SearchOA · PHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
- N-ary Index-Path Encoder and DecoderPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
- Trapping Rain WaterPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
- Fewest Coins CombinationPHONE SCREEN · Seen Nov 2026
- Recommend Films from Viewers Who Watched Everything You DidPHONE SCREEN · Seen Nov 2026
- Track New Values in Sorted OrderPHONE SCREEN · Seen Nov 2026
- Design Browser HistoryPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
Similar questions at other companies
- Balanced Parentheses with Sequential Left DeletionsGoogle · PHONE SCREENGoogle interview questions
- Word Break IIAmazon · PHONE SCREEN · ONSITE INTERVIEW
- Word Break IIWex · PHONE SCREEN
- Word Break IIInMobi · PHONE SCREENInMobi interview questions
- Word Break II: All SentencesMicrosoft · PHONE SCREEN · ONSITE INTERVIEWMicrosoft interview questions
- Palindrome PartitioningLondon Stock Exchange · PHONE SCREENLondon Stock Exchange interview questions
- All Palindrome PartitionsExpedia · OAExpedia interview questions
- Maximum Currency Conversion Along a Simple PathRippling · PHONE SCREEN · ONSITE INTERVIEWRippling interview questions
- Expression Add OperatorsPinterest · PHONE SCREENPinterest interview questions
- Palindrome with K DeletionsWhatNot · PHONE SCREENWhatNot interview questions
Bloomberg LP interview experiences
- Bloomberg AI-Assisted Coding Round, All Levels: 14 Experiences
- Bloomberg SWE Intern Interview Questions: 68 Questions
- Bloomberg Interview Questions, Level Not Reported: 65 Questions
- Bloomberg Experienced Design & More: 126 Questions (Part 2 of 2)
- Bloomberg Experienced SWE Interviews: 167 Questions (Part 1 of 2)
- Bloomberg New Grad Coding Questions: 121 Questions (Part 2 of 2)