Replace Question Marks in String
Filed under Directi
The question
Given a string containing 'a', 'b', 'c', or '?', replace the '?' such that no two consecutive characters are the same and the first and last characters are different. Output the lexicographically smallest string or 'Not Possible'.
No write-up yet. Related questions below have one.
Related Directi questions
Collected from public candidate posts and coding forums. Updated Nov 2026.