class Solution(object):

```
def sortColors(self, nums):
curr = 0
for _ in range(len(nums)):
if nums[curr] == 0:
x = nums.pop(curr)
nums.insert(0, x)
curr += 1
elif nums[curr] == 1:
curr += 1
else:
x = nums.pop(curr)
nums.append(x)
```