//this problem mainly improve the understanding of slow and pointers in the linked list which mainly used to detect loop in the linked list
Given the head of a linked list that may contain a loop. A loop means that the last node of the linked list is connected back to a node in the same list. The task is to Remove the loop from the linked list (if it exists).
eaxmple test case:-
input:1->2->3->4, pos = 1
this 'pos' tells to which position the end node is connceted in the given linked list, here 4 is connceted to 1 , which is at position 1.
output : 1->2->3->4
now there is no loops present in the linked list
//this problem mainly improve the understanding of slow and pointers in the linked list which mainly used to detect loop in the linked list
Given the head of a linked list that may contain a loop. A loop means that the last node of the linked list is connected back to a node in the same list. The task is to Remove the loop from the linked list (if it exists). eaxmple test case:- input:1->2->3->4, pos = 1 this 'pos' tells to which position the end node is connceted in the given linked list, here 4 is connceted to 1 , which is at position 1.
output : 1->2->3->4 now there is no loops present in the linked list