LearnPy Hub
← Arena
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
solution.py
Output appears here
Find All Anagrams · Python Arena problem · LearnPy Hub