DCP-272: Find the Intersection Back to All Problems

Easy Math > Basic Math


Rahul is very lazy person. His younger brother reads in class 8. One day his brother came to him and asked to solve a problem from set theory. The problem is about to find the Intersection of many sets. Intersection of many sets refers to the elements which are included to all sets. Here is an example of Intersection of two sets **A** and **B**, where **A ∩ B** is the expected result of this. ![enter image description here][1] As Rahul is very lazy, he asked you to write a program to solve this. Can you please help him? Input: ------ Input starts with an integer **T (1≤ T≤ 10)**, denoting the number of test cases. Each case contains an integer **S (2 ≤ S ≤ 10)** denoting the total number of elements of a Set . The next **S** lines will contain **N distinct** integers separated by spaces **(1≤ N≤ 20)** , denoting the elements of a Set. All the elements of set will be an positive integer number less than 1000. Output: ------- For each case of input, output will be a single line, which contains the elements of expected result separated by spaces in **increasing order**. As the answer could have no elements, print **Empty** in that case. Sample Input ------------ 2 2 1 2 4 3 5 2 10 3 1 19 22 102 3 1 2 3 4 Sample Output ------------- 1 2 3 Empty [1]: https://s3-ap-southeast-1.amazonaws.com/devskillimagestorage/questionimages/83adde1c-a64c-c722-2f25-08d45af7e586_c98c82b6879849e78aab7cefdd8f211b_W350xH250.jpg


Problem Setter:

(Account Deleted)

Please login to submit solution to this problem.

Problem Limits

Language Time Limit (seconds)
C 1.00
C++ 1.00
C++14 1.00
C# 1.00
Go 1.00
Java 1.00
JavaScript 1.00
Objective-C 1.00
Perl 1.00
PHP 1.00
Python 1.00
Python3 1.00
Ruby 1.00
VB.Net 1.00

Problem Stats

144/442

Solve/Submission

Ranking

# User Language Timing
01 Pure_Protea Cpp14 0.00s
02 Sarwar05 Cpp14 0.00s
03 imunir Cpp14 0.00s
04 red23495 Cpp14 0.00s
05 swapnilsaha Cpp14 0.00s
06 alamin39 Cpp14 0.00s
07 xpo6 Cpp14 0.00s
08 moshiur_cse15 Cpp14 0.00s
09 anik_JU Cpp14 0.00s
10 jabertuhin Cpp14 0.00s
11 Knight_King Cpp14 0.00s
12 emrul Cpp14 0.00s
13 prdx9_abir Cpp14 0.00s
14 zyyxxx Cpp14 0.00s
15 snow_man Cpp14 0.00s
16 shamimjucse Cpp14 0.00s
17 Rajan_sust Cpp14 0.00s
18 Ashef_Shahrior Cpp14 0.00s
19 Alice_2 Cpp14 0.00s
20 sonjoydabnath Cpp14 0.00s
21 MRITuhin Cpp14 0.00s
22 mbstu_nitai Cpp14 0.00s
23 ZERO Cpp14 0.00s
24 myhobby Cpp14 0.00s
25 Najat Cpp14 0.00s
26 kamrulashraf Cpp14 0.00s
27 SbrTa Cpp14 0.00s
28 Khayrul_34 Cpp14 0.00s
29 Jisancse Cpp14 0.00s
30 Code_Hunter Cpp14 0.00s
31 7Mahfuz Cpp14 0.00s
32 Optimus_primeV2 Cpp14 0.00s
33 FahimSifnatul Cpp14 0.00s
34 hasib35 Cpp14 0.00s
35 AlaminJust Cpp14 0.00s
36 sumit1993 Cpp14 0.00s
37 Trusted_Frustrated Cpp14 0.00s
38 Aman_khan Cpp14 0.00s
39 badhansen123 Cpp14 0.00s
40 mtmohim Cpp14 0.00s
41 Nazmul_7 Cpp14 0.00s
42 shailyroy Cpp14 0.00s
43 Puja1409 Cpp14 0.00s
44 jayed_al_hasan Cpp14 0.00s
45 Mr_adnan Cpp14 0.00s
46 indroneel Cpp14 0.00s
47 CodeSlayerOmega Cpp14 0.00s
48 shahincsejnu Cpp14 0.00s
49 Ansarul_14 Cpp14 0.00s
50 Gang_Of_Three_01 Cpp14 0.00s
Feedback

Your feedback is our precious!



Or call +88 02 9853138 for support