BETA

Difficulty Level: Easy

Submissions: 934 Accuracy:

48.82%

Shortest Common Supersequence
       

Given two strings str1 and str2, find the shortest common shortest common subsequence of the two strings.

Input:
The first line of input contains an integer T denoting the number of test cases.Each test case contains two space separated strings.

Output:
Output the length of the shortest common supersequence.

Constraints:
1<=T<=100

Example:
Input:

2
abcd xycd
efgh jghi
Output:
6
6

** For More Input/Output Examples Use 'Expected Output' option **

Contributor: Shubham Chaudhary

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.