Manoj, Vinoj and Jegan are the famous coders of TCE. One fine day Vinoj and Jegan challenge Manoj to solve a puzzle. That is Vinoj will select one string A. Similarly Jegan will choose one string B with the same size. You need to help Manoj to find the longest subsequence X of a string A which is a substring Y of a string B.
A : ABCD
B : BACDBDCD
The answer would be 3 as because 'ACD' is the longest subsequence of A which is also a substring of B.
The first line of input contains an integer T. Then T test cases follow. Each test case contains two space separated strings A and B.
For each test case in a new line print the required output.
1<=Length of strings <=100
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.