โ† Testbook questions

Sort 0/1/2 array; find duplicates in O(n) time and O(1) space

Filed under Testbook

The question

Sort an array of 0, 1 and 2 (basic then Dutch national flag), and find duplicates in O(n) time with constant extra space, solved with a hint.

No write-up yet. Related questions below have one.

Related Testbook questions

Collected from public candidate posts and coding forums. Updated Nov 2026.