Input is a cell array containing several strings. Find the largest continuous sub-string common to all strings. All strings are in lower case and unique answer exists.
Example:
in = {'cat','meowcat','concatenation'};
out = 'cat';
Solution Stats
Problem Comments
3 Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers67
Suggested Problems
-
Project Euler: Problem 7, Nth prime
1780 Solvers
-
269 Solvers
-
The Answer to Life, the Universe, and Everything
588 Solvers
-
1005 Solvers
-
String Array Basics, Part 1: Convert Cell Array to String Array; No Missing Values
2081 Solvers
More from this Author44
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
This problem requires more test cases. My solution as many others would fail for a case in which the searched substring is not ordered.
Rafael, If I am not misunderstanding you, the problem asks for a continuous sub-string.
I recommend a test suite example where multiple or all of the character strings in the input are of the same length.