So the goal here is to find any number that is equal to its immediate neighbors and mark it true. Here is some examples:
x = [2 2 3 4 3 4 6 9 9] y = [1 1 0 0 0 0 0 1 1]
or
x = [2 2 2 2 2 9] y = [1 1 1 1 1 0]
Have fun!
This solution is actually incorrect (but passes the test suite).
Back to basics 9 - Indexed References
348 Solvers
Sum of diagonal of a square matrix
1159 Solvers
469 Solvers
251 Solvers
Is this triangle right-angled?
1918 Solvers
Solution 783991
This solution takes advantage of the limited test cases where the maximum length of repeated segments is <= 2.