How many pizzas ?
##### Submissions: 1787   Accuracy: 32.4%   Difficulty: Basic   Marks: 1

You are given two stacks of pizzas, but you can only take those pizzas from one stack that are also present in the other stack, in the same order, the pizzas that you can take need not be continuous.

Print the maximum amount of pizzas that you can take. (You can only take pizzas from one of the two stacks)

INPUT

The first line contains only one integer, t, the number of test cases.

For each case, there are two lines:

Line 1: 10 integers, which represent radii of the pizzas in the first stack.

Line 2: 10 integers, each of which represent radii of pizzas in the second stack.

OUTPUT:

For each case, a single integer that gives the maximum amount of pizzas that you can take.

Constraints:

1<=T<=100

Example:

Input:

1
891 424 945 741 897 514 692 221 678 168
702 952 221 614 69 753 821 971 318 364

Output:

1

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

Contributor: Siddharth Dungarwal
Author: sd5869

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.