Medium
Quiz
#86 Partition List
APPROACH
Partition linked list head so that all nodes with values strictly less than x come before all nodes with values at least x. The original relative order within each partition must be maintained.
Example 1:
Input: head = [1,4,3,2,5,2], x = 3
Output: [1,2,2,4,3,5]
Example 2:
Input: head = [2,1], x = 2
Output: [1,2]
1 of 4
1:00
What is the optimal approach for this problem?