Remove cycle in LL


plz check and mark where to modify the code!

@Ashu1318
https://hack.codingblocks.com/app/contests/1281/1307/problem
for this question just write ur code for detection and removal of loop in floydCycleRemoval() function

bool floydCycleRemoval(Node *head)
{
    Node*slow = head;
    Node*fast = head;

    while(fast!=NULL && fast->next!=NULL)
    {
        fast=fast->next->next;///Taking 2 steps
        slow=slow->next;///Taking 1 step

        if(fast==slow)
        {
            slow=head;
            while(slow->next!=fast->next)
            {

                fast=fast->next;
                slow=slow->next;
            }
            fast->next=NULL;
            return true;
        }
    }
    return false;

}

but in case if we gave linked list 1->2->3->4->5->3 so in this how it does not work means how can we say cycle is present

see this is the order version and like this does not even require the floyd algo

in this just maintain a map and while we interest a new value check if it already present in the map
if yes
print cycle is present
else if the entire i/p is processed return not present