It should be noted that spaces should be ignored or else test suites 3 and 5 fail.
good use of 'hankel' function
cool solution
Sorry about this, but I got stuck and I want to learn how to do it. After looking at several solutions, I found my mistake and was able to create my own solution :)
What happens if the test suite changed in the future?
This solution is not correct in general, as the way of using hankel here, generates n-1 fake fragments
Clever usage of the Hankel matrix. I don't automatically think of the Hankel for this application, but it really works well. Thanks - I've learned something
What's the point of a 'solution' like this? It passes the test suite, but in what way was it interesting for you to write it?
Make the vector [1 2 3 4 5 6 7 8 9 10]
35585 Solvers
2486 Solvers
Getting the indices from a vector
3214 Solvers
Make a run-length companion vector
512 Solvers
484 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!