Answered step by step
Verified Expert Solution
Link Copied!

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)

image text in transcribed

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 212

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Making Databases Work The Pragmatic Wisdom Of Michael Stonebraker

Authors: Michael L. Brodie

1st Edition

1947487167, 978-1947487161

More Books

Students also viewed these Databases questions

Question

What are (a) TAKT time, (b) SMED, (c) JIDOKA, and (d) PAKA-yokel

Answered: 1 week ago

Question

When do you use video conferencing?

Answered: 1 week ago

Question

6. Explain the power of labels.

Answered: 1 week ago

Question

10. Discuss the complexities of language policies.

Answered: 1 week ago