You are provided two strings A and B. You have to transform string A into string B in minimum number of steps. Only one operation is allowed, chose any of the characters in string A and place it in the front of A. If its not possible to transform string A into string B then print -1 otherwise print the minimum number of steps required.
Note: All the characters in the string are lowercase English characters.
The first line contains integer T, denoting number of test cases. Then T test cases follow .
The first line of each test case contains two space separated strings A and B.
Print in a new line the answer of each test case .
If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.