Partition
Write code to partition a list around a value x, such that all elements less than x come before all elements greater than or equal to x.
The element x can appear anywhere in the "right partition".
Example:
Input: [3, 5, 8, 5, 10, 2, 1], x = 5
Output: [3, 2, 1, 5, 8, 5, 10] (any valid partition is acceptable)
Hints
solution.py
Python ready
Test Output
▶
Click "Run Tests" to execute your code