Given a text str[0..n-1] and a pattern pat[0..m-1], write a program with a function PatternSearch(char pat[], char str[]) that prints all occurrences of pat[] in str[]. Given that n > m.
1. Iterate over string for i from 0 to n – 1 (n = string size). 2. For every value of i, slide pattern over text one by one & check for match. 3. If there’s match, slide by 1 to check for subsequent matches.