Intersection Of Two Sorted Arrays

Python Medium 6 views
Back to Questions

Problem Description

For each testcase you get two sorted arrays. Output unique common elements in increasing order (space-separated) or EMPTY.

Input Format

First integer t. For each: n m then n ints then m ints.

Output Format

t lines intersections.

Sample Test Case

Input:
1 5 6 1 2 2 3 5 2 2 3 4 5 6
Output:
2 3 5

Constraints

Sum of n+m over all testcases

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev Next