Intersection (Unique Sorted)

PHP Medium 9 views
Back to Questions

Problem Description

Given two arrays, print unique common values in increasing order.

Input Format

Line1 n m. Line2 n ints. Line3 m ints.

Output Format

One line values.

Sample Test Case

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

Constraints

n+m

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev Next