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)
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.
For each case, a single integer that gives the maximum amount of pizzas that you can take.
891 424 945 741 897 514 692 221 678 168
702 952 221 614 69 753 821 971 318 364
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.