Skip to content

Practice Middle of the Linked List

Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.

Easy#876
LeetCode Problem

Middle of the Linked List

Problem Statement

Given the head of a singly linked list, return the middle node of the linked list. If there are two middle nodes, return the second middle node.

Source: Middle of the Linked List on LeetCode. Use the original task for its coding environment and submissions.

Examples

# Example 1

Input
head = [1,2,3,4,5]
Output
[3,4,5]

# Example 2

Input
head = [1,2,3,4,5,6]
Output
[4,5,6]

Constraints

The number of nodes in the list is in the range [1, 100].
1 <= Node.val <= 100

Related LeetCode Problems

Practice more problems similar to Middle of the Linked List.

Review your practice with PhantomCodeAI

After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.