Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The code should be in python and that code should be run for all test cases You have been given two integer arrays/list(ARR1 and ARR2)
The code should be in python and that code should be run for all test cases
You have been given two integer arrays/list(ARR1 and ARR2) of size N and M, respectively. You need to print their intersection; An intersection for this problem can be defined when both the arrays/lists contain a particular value or to put it in other words, when there is a common value that exists in both the arrays/lists. The first line contains an Integer 'l' which denotes the number of test cases or queries to be run. Then the test cases follow. First line of each test case or query contains an integer "N" representing the size of the first array/list Second line contains "N' single space separated integers representing the elements of the first the array/list. Third line contains an integer 'M' representing the size of the second array/list. Fourth line contains 'M' single space separated integers representing the elements of the second array.dist. Output format For each test case, print the intersection elements in a row, separated by a single space.) Output for every test case will be printed in a separate line. Sample Input 1 2 6 268543 4 234 22 10 10 10 Sample Output 1 : 243 10 Sample Input 2 : 1 4 26 12 5 12342 Sample Output 2 212Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started