0708. Insert into a Sorted Circular Linked List
Description
**Input:** head = [3,4,1], insertVal = 2
**Output:** [3,4,1,2]
**Explanation:** In the figure above, there is a sorted circular list of three elements. You are given a reference to the node with value 3, and we need to insert 2 into the list. The new node should be inserted between node 1 and node 3. After the insertion, the list should look like this, and we should still return node 3.
**Input:** head = [], insertVal = 1
**Output:** [1]
**Explanation:** The list is empty (given head is null). We create a new single circular list and return the reference to that single node.**Input:** head = [1], insertVal = 0
**Output:** [1,0]ac
Last updated
