Find all occurrences of a pattern in a text
String Matching Problem:
Given text array T[1..n] and pattern array P[1..m] of characters from alphabet , find all s such that T[s+1..s+m] = P[1..m], i.e., P occurs with shift s in T.
Example