CodingMedium
Minimum max distinct characters after character swaps
Filed under Directi
The question
Given two strings s and p of the same length, where a valid operation allows exchanging characters at the same index between s and p. Find the minimum possible value of dist(s, p) after any number of operations, where dist is defined as the maximum of distinct characters in a and distinct characters in b.
No write-up yet. Related questions below have one.
Related Directi questions
Collected from public candidate posts and coding forums. Updated Nov 2026.