Escolar Documentos
Profissional Documentos
Cultura Documentos
The function returns position of the first pattern of at least 3 characters that occurs twice in the string. Examples: A) I------------------------------------| |------------------------------------| 1 0 1 0 1
Function should return 0. As the pattern 101 is repeated in the string and first occurrence is at position 0 . B) I------------------------------------| |------------------------------------| 0 0 0 1 0 0 0 0 0
Function should return 1. As the pattern 001 is repeated in the string and first occurrence is at position 1. C) 0