solution.py
⌘↵ runLoading...
Sort Colors (Dutch National Flag)
mediumYou've got this! Start small, think out loud.
Given an array with values 0, 1, and 2 (representing red, white, blue), sort them in-place in a single pass without using Python's built-in sort.
Time:O(n)
Space:O(1)
three-pointersin-placegoogle-favorite
OUTPUT
Run your code to see output