Remove All Repeated Values from a Linked List
Updated
Problem statement
The values of a singly linked list are provided in traversal order. Remove every node whose value occurs more than once, and return the remaining values in their original order.
This array representation preserves the linked-list filtering contract while keeping the callable interface deterministic.
Function
removeRepeatedValues(values: int[]) → int[]Examples
Example 1
values = [1,1,2,2,2,3,4,4]return = [3]Only 3 occurs exactly once.
Example 2
values = [1,2,3]return = [1,2,3]Every node is unique.
Constraints
0 <= values.length <= 100000.-10^9 <= values[i] <= 10^9.
More Arista Networks interview questions
- First Missing Number in a Consecutive ArrayOA · PHONE SCREEN · Seen Oct 2026
- Trace Nested Object Destruction OrderPHONE SCREEN · Seen Oct 2026
- Trace Pointer Rebinding and Pointee UpdatesPHONE SCREEN · Seen Oct 2026
- Swap Adjacent NibblesPHONE SCREEN · Seen Aug 2026
- Unique Target-Sum Pairs in a Sorted Doubly Linked ListPHONE SCREEN · Seen Aug 2026
- Generic Stack Operation SequencePHONE SCREEN · Seen Aug 2026
- API Bandwidth AllocationOA · Seen Sep 2026
- LFU CacheOA · Seen Sep 2026
- Maximum Server Processing TimeOA · Seen Aug 2026
- Minimum Adjacent Merges to Form a PalindromeOA · Seen Aug 2026
Similar questions at other companies
- Meta Copy List with Random PointerMeta · PHONE SCREEN · ONSITE INTERVIEWMeta interview questions
- Deep Copy a Random-Pointer ListBloomberg LP · PHONE SCREEN · ONSITE INTERVIEWBloomberg LP interview questions
- Deep Copy a Random-Pointer ListSuperhuman · PHONE SCREENSuperhuman interview questions
- Deep Copy a Random-Pointer ListAmazon · ONSITE INTERVIEW
- Merchant Payout Reserve CalculatorStripe · PHONE SCREENStripe interview questions
- Price CheckBlue Origin · PHONE SCREEN
- Majority ElementByteDance · PHONE SCREENByteDance interview questions
- Detect a Straight FlushTemu · PHONE SCREENTemu interview questions
- Find Unique ElementsCisco · PHONE SCREENCisco interview questions
- Shared Courses for Every Pair of StudentsCrunchyroll · PHONE SCREENCrunchyroll interview questions