Problem 3070. Pattern Recognition 3 - Variable Unit and Array Length (including cell arrays)

You will be given various arrays, composed of numbers or strings, including cell arrays of strings. For this problem, the pattern unit length is variable, ranging from three to half the array length (the unit will be completely repeated at least once). Write a function to determine if the supplied array is a strict repeating pattern. The array will not necessarily have a length that is a multiple of the unit length.

For example, [1 2 3 4 5 1 2 3 4 5 1 2 3] would return true since the first block (1:5) is strictly repeated through the remainder of the array (including the last [1 2 3]). On the other hand, 'abcabcabcabcabcabea' would return false, since the last complete block is 'abe' rather than 'abc', as indicated by the first block.

This problem is a follow-on to Problem 3068 and Problem 3069.

Solution Stats

47.22% Correct | 52.78% Incorrect
Last Solution submitted on Jun 11, 2024

Problem Comments

Solution Comments

Show comments

Problem Recent Solvers44

Suggested Problems

More from this Author139

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!