Example 1

Example 2

Example 3

1 <= nums.length <= 1051 <= nums[i] <= 105All elements in nums are unique.The number of nodes in the given list is in the range [1, 105].1 <= Node.val <= 105The input is generated such that there is at least one node in the linked list that has a value not present in nums.Example 1

Example 2

Example 3

1 <= nums.length <= 1051 <= nums[i] <= 105All elements in nums are unique.The number of nodes in the given list is in the range [1, 105].1 <= Node.val <= 105The input is generated such that there is at least one node in the linked list that has a value not present in nums.