All submissions for this problem are available.Akshay is expecting a good news from Mrs Batra on $27th Dec$ but he is disheartened by the fact that she got pregnant by the sperm of Diljit because of a swap of sperms during the IVF process. He is now determined that his baby will get the name from the list of names of his choice but at the same time, Diljit also has decided few names which he wants for his child of Akshay's wife. As they are busy dancing on the song Sauda Khara Khara they have asked you to solve the conflict. Given two names of equal length, you have to return the length of the longest name that can be generated from both names individually by deleting 0 or more characters. ###Input - First line will contain $T$, number of test cases. Then the test cases follow. - Each test case contains a single line of input, two names, $A$, name of Akshay's choice and $D$, name of Diljit's choice. ###Output - Print length of the longest name which can be generated. ###Constraints - $1 \leq T \leq 1000$ - $1 \leq |A|, |D| \leq 5000$ - All characters are upper case in the range ascii[A-Z]. - Sum of |$A| * |D|$ over all test cases does not exceed $5.10^7$ ###Sample Input 1 HARRY SALLY ###Sample Output 2 ###EXPLANATION: The longest name that can be formed by deleting 0 or more characters from $HARRY$ and $SALLY$ is $AY$, whose length is 2.
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, rust, SCALA, swift, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, SQL, kotlin, PERL6, TEXT, SCM chicken, PYP3, CLOJ, R, COB, FS|
Fetching successful submissions
If you are still having problems, see a sample solution here.