| 53 | |
| 54 | """ |
| 55 | class Solution(object): |
| 56 | def sortColors(self, nums): |
| 57 | """ |
| 58 | :type nums: List[int] |
| 59 | :rtype: void Do not return anything, modify nums in-place instead. |
| 60 | """ |
| 61 | |
| 62 | index = 0 |
| 63 | times = 0 |
| 64 | length = len(nums) |
| 65 | |
| 66 | for i in range(length): |
| 67 | if nums[index] == 0: |
| 68 | x = nums.pop(index) |
| 69 | nums.insert(0, x) |
| 70 | index += 1 |
| 71 | elif nums[index] == 2: |
| 72 | x = nums.pop(index) |
| 73 | nums.append(x) |
| 74 | else: |
| 75 | index += 1 |
nothing calls this directly
no outgoing calls
no test coverage detected