BETA
This is a school problem. Successful submissions of this are not counted in user ratings.

Submissions : 2401 Accuracy :

19.91

Find Substring from last of the Given String
     

Given a string and a sub-string, your task is to find the last index of that sub-string that appears in the given String.
If the given sub-string doesn't appear in the string then print "-1".

Input:
The first line of input contains an integer T denoting the no of test cases. Then T test cases follow. Each test case contain a sub-string S and a string S1.

Output: 
For each test case in a new line print the required result.

Constraints:
1<=T<=100
1<=S, S1<=10000

Example:

Input:
2
geek
geeksforgeeks
abc
ababc

Output:
9
3

**For More Examples Use Expected Output**


Contributor: Saksham Raj Seth

Set Default Code

					   
Result:
It is recommended to test your code before clicking 'Submit' button!



                   



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.