Let
a = [9 9 9 9 9 9 8 8 8 8 7 7 7 6 6 6 5 5 4 2 1] b = [1 1 1 3 3 3 3 3 4 4 4 4 4 10 10 10]
Output should be
[9 8 7 6 5 4 2 1 3 10]
Solution Stats
Problem Comments
1 Comment
Solution Comments
Show comments
Loading...
Problem Recent Solvers108
Suggested Problems
-
Make the vector [1 2 3 4 5 6 7 8 9 10]
52662 Solvers
-
2599 Solvers
-
Replace NaNs with the number that appears to its left in the row.
3059 Solvers
-
Convert a Cell Array into an Array
2184 Solvers
-
Cumulative product of a vector
299 Solvers
More from this Author9
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
I think the description and test suite on this problem is slightly off. When I see 'union' I already assume that no duplicates are permitted and order is irrelevant.