arrow_back Back to Challenges

#206 Reverse Linked List

Easy Acceptance 0%
description

Problem Description

Given the `head` of a singly linked list, reverse the list, and return the reversed list.

checklist Constraints

The number of nodes in the list is the range [0, 5000].
-5000 <= Node.val <= 5000

science Examples

Case #1

In: head = [1,2,3,4,5]
Out: [5,4,3,2,1]

Case #2

In: head = [1,2]
Out: [2,1]

Mastery Tags

Linked List Recursion

Hiring Companies

Amazon Apple Microsoft
code

Integrated IDE

code_blocks
Coding
psychology
Aptitude