Rearrange a list so that all elements less than the pivot come before those greater than or equal to it.
Constraints
Example
```python >>> nums = [9, 2, 5, 1, 5, 3] >>> pivot = 5 >>> k = partition(nums, 5) >>> k 3 >>> nums [2, 1, 3, 9, 5, 5] # example valid rearrangement >>> nums = [] >>> k = partition(nums, 0) >>> k 0 >>> nums = [1, 2, 3] >>> k = partition(nums, 2) >>> k 2 ```
Recent Submissions
No submissions yet — hit Run Tests to try!
Hints