BETA
School Problem's Submission isn't counted in score!

Submissions: 2641 Accuracy:

20.71%

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 Input/Output Examples Use 'Expected Output' option **

Contributor: Saksham Raj Seth

Set Default Code

					   
It is recommended to 'Compile & Test' your code before clicking 'Submit'!

Compilation/Execution Result:

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