Circular Linked List

In these types of questions, how are we supposed to make a linked list for the given input so that it makes a cycle?

@Kajal Say If INPUT IS 1 2 3 4 5 2 3 -1
form a linked list 1->2->3->4>5 then you see that 2 has already been visited (So for this you can maintain a map or a visited array…whenever you see that a node is already visited, connect next pointer of previous node to that node.) so connect the next pointer of 5 to 2. This way you have created the circular linked list .