Easy C++ Solution recursive


#1

ListNode* Solution::reverseList(ListNode* A) {
if(A->next==NULL||A==NULL)
{
return A;
}
ListNode *h=reverseList(A->next);
A->next->next=A;
A->next=NULL;
return h;
}