Problem 2640. Find similar sequences
Solution Stats
Problem Comments
-
5 Comments
[3 1 5 7 0] and [3 2 5 7 0] is similar or not?
'Rows are considered similar if the numbers common to both rows are in the exact same order with no other numbers in between'. Numbers in common are 3, 5, 7. They're in the exact same order. But there is a number in between in both rows, so they're not similar.
Basically, find the numbers that are common to both rows. If they're consecutive in both, with no gaps, keep the row
I see
Maybe a better description for the problem would be that the largest sequence of equal numbers between two rows must have the same size and be unique.
Solution Comments
-
1 Comment
I've added a test to prevent this from working
Problem Recent Solvers82
Suggested Problems
-
Remove any row in which a NaN appears
7887 Solvers
-
Remove all the words that end with "ain"
1834 Solvers
-
The Goldbach Conjecture, Part 2
1911 Solvers
-
324 Solvers
-
Relative ratio of "1" in binary number
932 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!