Please enter your email address or userHandle.
Given two strings A and B you need to find the last occurrence ( 1 based indexing) of string B in string A.
first line of input contains of an integer 'T' denoting number of test cases
first line of each testcase contains String A.
Second line of each testcase contains String B.
for each case print an integer depicting the starting index of matched string ,corresponding to the answer .
print -1 if the string B is not Found in A.
We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?
Login to access your submissions.
Please choose 'ReadOnlyMode' if you needn't to 'Edit' the problem e.g. viewing OJ's solution, TestCase Files (TCFs), TimeLimit etc.