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

142/435

Solve/Submission

Ranking

# User Language Timing
01 anowar1112 Cpp14 0.00s
02 rana_cse Cpp14 0.00s
03 mahmudulcsejnu Cpp14 0.00s
04 myhobby Cpp14 0.00s
05 nafiz0080 Cpp14 0.00s
06 alamin39 Cpp14 0.00s
07 shailyroy Cpp14 0.00s
08 swapnilsaha Cpp14 0.00s
09 xpo6 Cpp14 0.00s
10 mtmohim Cpp14 0.00s
11 Puja1409 Cpp14 0.00s
12 Gang_Of_Three_01 Cpp14 0.00s
13 murad_al_wajed Cpp14 0.00s
14 imunir Cpp14 0.00s
15 badhansen123 Cpp14 0.00s
16 skmonir Cpp14 0.00s
17 loop_breaker Cpp14 0.00s
18 aseem_cu Cpp14 0.00s
19 anikatahsin Cpp14 0.00s
20 jabertuhin Cpp14 0.00s
21 sonjoydabnath Cpp14 0.00s
22 Nazmul_WUB Cpp14 0.00s
23 mbstu_nitai Cpp14 0.00s
24 Trusted_Frustrated Cpp14 0.00s
25 Rijoanul_Shanto Cpp14 0.00s
26 showmic Cpp14 0.00s
27 zyyxxx Cpp14 0.00s
28 Optimus_primeV2 Cpp14 0.00s
29 Jisancse Cpp14 0.00s
30 emrul Cpp14 0.00s
31 kamrulashraf Cpp14 0.00s
32 FahimSifnatul Cpp14 0.00s
33 tariqiitju Cpp 0.00s
34 7Mahfuz Cpp14 0.00s
35 Najat Cpp14 0.00s
36 atikhashmee Cpp14 0.00s
37 shamimjucse Cpp14 0.00s
38 Mr_adnan Cpp14 0.00s
39 Pure_Protea Cpp14 0.00s
40 Knight_King Cpp14 0.00s
41 MRITuhin Cpp14 0.00s
42 shahincsejnu Cpp14 0.00s
43 Aman_khan Cpp14 0.00s
44 SbrTa Cpp14 0.00s
45 arafatduha Cpp14 0.00s
46 hasib35 Cpp14 0.00s
47 dip_BRUR Cpp14 0.00s
48 LateNightCoder Cpp14 0.00s
49 pulak_ict_mbstu Cpp14 0.00s
50 burhan103335 Cpp14 0.00s
Feedback

Your feedback is our precious!



Or call +88 02 9853138 for support