some of the test cases not running
i have kept a pointer x to move it to the last of the linked list and compare data of head and last element
Then i have delete x that is the last element and made a recursive call by passing head->next as argument