5.3 Tanya and Keyboard
(RankList for this Question)
Score: 80pts
Time Limit: 2.00 sec
Tanya's keyboard has been acting up. While typing, it often presses extra buttons and adds extra letters to the words.

Tanya being a smart problem solver got fed up with correcting his mistakes herself, that’s why she decided to invent the function that will correct the words itself.

After analyzing the cases, all one needs is to delete one letter for the word to make the word correct. Solve this task for her: she has a printed word and a word from the dictionary, and you should delete one letter from the first word to get the second one. Which letter would you delete?

Constraints
1 <= str.length() <= 10^6

Input Format
The input data contains two strings, consisting of lower-case Latin letters. The length of each string is from 1 to 10^6 symbols inclusive, the first string contains exactly 1 symbol more than the second one.

Output Format
In the first line output the "number of positions" of the symbols in the first string, after the deletion of which the first string becomes identical to the second one.

Example 1
Input:
abdrakadabra
abrakadabra

Output:
1
3

Explanation:
The only letter that can be deleted is at index 3.

Example 2
Input:
aa
a

Output:
2
1 2

Explanation:
Any letter can be deleted here.

Example 3
Input:
codecell
abcdefg

Output:
0

Explanation:
It is impossible to make the first string identical to the second string by deleting one symbol, hence output is 0.

Log In to solve the Question