Given the head of a linked list and a value x, partition it so that all nodes with value less than x come before nodes with value greater than or equal to x. Preserve the original relative order within each partition. The list is given as an array; return the partitioned array. Input: '[list], x'.
Input: '[list], x'.
Output: Array — the partitioned list.
Input: [1,4,3,2,5,2], 3
Output: [1,2,2,4,3,5]
Explanation: Values <3 first, order preserved.Input: [2,1], 2
Output: [1,2]
Explanation: 1 before 2.Input: [1], 0
Output: [1]
Explanation: Single node.0<=n<=200-200<=value,x<=200