Medium
Given the head of a linked list and a value k, partition it so that all nodes with value less than k come before nodes with value greater than or equal to k. Preserve the original relative order within each part. (LeetCode calls this parameter x.)
Input: head = [1,4,3,2,5,2], k = 3 Output: [1,2,2,4,3,5]
Input: head = [2,1], k = 2 Output: [1,2]