Sort an array of 0s, 1s and 2s maintaining relative order
Filed under OLA
The question
Given an array containing only 0s, 1s, and 2s, sort the array while maintaining the original relative order in which they appeared.
No write-up yet. Related questions below have one.
Related OLA questions
Collected from public candidate posts and coding forums. Updated Nov 2026.