Inexact match
Easy
Execution time limit is 1 second
Runtime memory usage limit is 64 megabytes
Given two strings, (p) and (t), your task is to find all occurrences of (p) within (t) as a substring, allowing for at most one character mismatch.
Input
The first line of the input contains the string (p), and the second line contains the string (t). The lengths of (p) and (t) satisfy (1 |p|, |t| 10^6). Both strings consist of letters from the Latin alphabet.
Output
On the first line, print the number of times (p) appears in (t) with at most one character mismatch. On the second line, print the starting positions of these occurrences in (t) in ascending order. The positions should be numbered starting from one.
Examples
Input #1
Answer #1
Submissions 2K
Acceptance rate 14%