Z Algorithm For Pattern Searching
1. You are given two strings s1 and s2.Input Format
2. s1 represents a text and s2 represents a pattern.
3. You have to print the starting index for all occurrences of the pattern in the given text string.
Two strings s1 and s2 in two different lines.Output Format
Starting index for all occurrences of the pattern in the given text string.Question Video
1 <= length of the strings <= 10^4Sample Input
Asked in Companies