Problem 39. Which values occur exactly three times?
Return a list of all values (sorted smallest to largest) that appear exactly three times in the input vector x. So if
x = [1 2 5 2 2 7 8 3 3 1 3 8 8 8]
then
y = [2 3]
Solution Stats
Problem Comments
-
5 Comments
Show
2 older comments
Luyu Wang
on 10 Jul 2018
the in-build function tabulate cannot used in here.
Mitchell
on 27 Nov 2023
I never thought I could use this line of code for this problem but what do you know
Long Runjia Yu
on 11 Feb 2024
i have used a loop construct for this but apparently there are far faster ways (length: 20ish instead of 80-100)
Solution Comments
Show commentsProblem Recent Solvers5139
Suggested Problems
-
3888 Solvers
-
2387 Solvers
-
Arrange Vector in descending order
11823 Solvers
-
335 Solvers
-
685 Solvers
More from this Author96
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!