Find Loop Time : O(n) Space : O(1) 123456789101112131415161718192021222324#include <vector>using namespace std;class LinkedList {public: int value; LinkedList *next; LinkedList(int value);};LinkedList *findLoop(LinkedList *head) { LinkedList *slow = head, *fast = head; do { slow = slow->next; fast = fast->next->next; }while(slow != fast); while(head != slow) { slow = slow->next; head = head->next; } return head;}