IntermediateRating 1400
Find All Anagrams
Print the starting indices of all substrings of s that are anagrams of p, separated by spaces, or -1.
Input
Two lines: s, then p.
Output
Indices or -1.
Sample 1
Input
cbaebabacd abc
Output
0 6
Sample 2
Input
abab ab
Output
0 1 2
Output appears here