LeetCode 206: Reverse Linked List — Step-by-Step Visual Trace
The Problem
Given the head of a singly linked list, reverse the list and return the reversed list.
Input: head = [1, 2, 3, 4, 5]
Output: [5, 4, 3, 2, 1]
This is one of the most classic interview questions — simple enough to explain in 30 seconds, but...
blog.tracelit.dev2 min read