← Microsoft questions

Minimum modifications to satisfy sequence constraint

Filed under Microsoft

Given a string of attacks by A and B, modify the minimum number of characters so that for every prefix of the string, the count of A's attacks is >= count of B's attacks.

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 Microsoft questions

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