Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
Could you put the elements smaller than the pivot and greater than the pivot in a separate list as in the sequence that they occur?
With the separate lists generated, could you then generate the result?