← Questions

Reverse a linked list between nodes with equal values

0
MetaCodingLast asked Sep 2025

In a singly linked list, whenever two nodes hold the same value, reverse the part of the list between them. Clarify with the interviewer which pairs count and whether the matching nodes themselves move, then do it in place in one pass.

Write and test your solution herePython in your browser, the question's tests level by level, saved for you.Sign in to start coding