CodingMedium
Minimum swaps to make string of C and D alternating
Filed under Commvault
The question
Given a string consisting of only the characters 'C' and 'D', determine the minimum number of swaps required to make the characters alternate.
No write-up yet. Related questions below have one.
Related Commvault questions
Collected from public candidate posts and coding forums. Updated Nov 2026.