All Problems

Sort Colors

MediumarrayExpected: O(n) time, O(1) spaceInterview Context
sorting

Problem

Given an array with objects colored red (0), white (1), or blue (2), sort them in-place in order.

Loading...