Learn
Practice
Interview
Resources
Newsletter
F
Toggle theme
0
F
0
Toggle menu
Animations
← Back to All Animations
Sort Colors
Bookmark
Input
Example 1
Example 2
Example 3
Custom
nums
=
[2, 0, 2, 1, 1, 0]
0
1
2
3
4
5
2
0
2
1
1
0
0
1
2
3
4
5
2
0
2
1
1
0
0
1
2
3
4
5
2
0
2
1
1
0
low
mid
high
0
1
2
3
4
5
0
0
2
1
1
2
low
mid
high
0
1
2
3
4
5
0
0
2
1
1
2
low
mid
high
0
1
2
3
4
5
0
0
2
1
1
2
low
mid
high
0
1
2
3
4
5
0
0
2
1
1
2
low
mid
high
0
1
2
3
4
5
0
0
1
1
2
2
low
mid
high
0
1
2
3
4
5
0
0
1
1
2
2
low
mid
high
0
1
2
3
4
5
0
0
1
1
2
2
low
mid
high
0
1
2
3
4
5
0
0
1
1
2
2
algo
master
.
io
Step:
Start: Sort colors using Dutch National Flag algorithm
0 / 18
Input
Example 1
Example 2
Example 3
Custom
nums
=
[2, 0, 2, 1, 1, 0]
0 / 18
algo
master
.
io
Step:
Start: Sort colors using Dutch National Flag algorithm