Question: The third line consists M space separated integersdenot The input will be re The output consists of two lines: The first line consists space separted

The third line consists M space separated integersdenot
The input will be re
The output consists of two lines:
The first line consists space separted elements of Intersection array.
The second line consists space separted elements of union array.
The output will be matched to the candidate's output printed on the STDOUT
Constraints:
1N104
1M104
-109arr1[i],arr2[i]109
Example:
Input:
54
31415
2718
Output:
1
1234578
Explanation:
The intersection of arr 1 and arr 2 contains the elements that are common to both arroys, whilch is (1).
The union of arr 1 and arr 2 contains all unique elements from both arrays, with duplicates removed, resilting
Sample input
44
2468
1357
Sample Output
-1
Secure Exam Browser 1.5.5
The third line consists M space separated

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!