NeetCode #339LC-1836MediumLinked List
← Back to All Problems

#339 · #1836 · Remove Duplicates From an Unsorted Linked List(从未排序的链表中移除重复元素)

📌 Problem Statement & Constraints

Given the head of an unsorted linked list, remove all nodes that have duplicate values, keeping only the distinct values, and return the head. Constraints: 1 <= n <= 10^5, 1 <= Node.val <= 10^4.
🔒

Sign In to Unlock Full Solutions for All 973 Problems

Sign in to access step-by-step logic, benchmark Python3 code, complexity breakdown, and offline export!