You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Problem Statement: Given the head of a singly linked list, write a program to reverse the linked list, and return the head pointer to the reversed list.
// Input Format:
// head = [3,6,8,10]
// This means the given linked list is 3->6->8->10 with head pointer at node 3.
// Result:
// Output = [10,6,8,3]
// This means, after reversal, the list should be 10->6->8->3 with the head pointer at node 10.