Given a vector of integers, remove the elements that have appeared only once. The output elements should be in exact order as the input except the single elements being removed.
Example:
Input: vec = [2 2 1 2 3 4 1 2];
Output: [2 2 1 2 1 2];
Loops are not allowed.

Solution Stats

487 Solutions

136 Solvers

Last Solution submitted on Jul 21, 2026

Last 200 Solutions

Problem Comments

Solution Comments

Show comments
Loading...

Problem Recent Solvers136

Suggested Problems

More from this Author44

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!