Sort array of 0s, 1s and 2s in O(1) space
Filed under Unthinkable Solutions
The question
Sort an array containing only 0s, 1s, and 2s with O(1) space complexity and O(n) time complexity.
No write-up yet. Related questions below have one.
Related Unthinkable Solutions questions
Collected from public candidate posts and coding forums. Updated Nov 2026.