This problem requires more test cases. My solution as many others would fail for a case in which the searched substring is not ordered.
3162 Solvers
2215 Solvers
357 Solvers
277 Solvers
118 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!