DCP-497: Exactly Two Times Back to All Problems

Easy Beginners Problems > Implementation


You are given an array **A** with total **N** integer numbers ranging from **1** to **N-1**, where all elements from **1** to **N-1** appears exactly once but one element appears exactly twice. Your task is to find out that element which occur exactly two times. Input: ------ Input starts with an integer **T (1<=T<=20)**, denoting the number of test cases.<br> Each case contains an integer **N (2 ≤ N ≤ 10000)** denoting the number of elements of array **A**. The next line will contain **N** integers separated by spaces, denoting the elements of the array **A**. Each of these integers will be in the range from **1** to **N-1**. Output: ------- For each case of input, output the element which occurs exactly twice in the given array. Sample Input ------------ 1 5 1 2 4 3 1 Sample Output ------------- 1


Problem Setter:

Bishal Gautam

Please login to submit solution to this problem.

Problem Limits

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

Problem Stats

263/650

Solve/Submission

Ranking

# User Language Timing
01 Pure_Protea Cpp14 0.00s
02 notorious_94 Cpp14 0.01s
03 asmatikur C 0.01s
04 mhiceiuk Cpp 0.01s
05 Datta Cpp 0.01s
06 Bhuiyan C 0.01s
07 Chayti_Saha98 Cpp 0.01s
08 UH55 Cpp 0.01s
09 tanmoy_1703002 C 0.01s
10 Sarwar05 Cpp14 0.01s
11 rmahbub63 C 0.01s
12 terminator_c Cpp 0.01s
13 Anubis Cpp 0.01s
14 haliban_25 C 0.01s
15 rashedul_riad Cpp 0.01s
16 rakibislam1996 Cpp14 0.01s
17 mohibur Cpp 0.01s
18 SMunira C 0.02s
19 Bisnu039 Cpp 0.02s
20 Freaky_Weirdo Cpp 0.02s
21 Robin008 Cpp 0.02s
22 Salam_35s Cpp 0.02s
23 mepromee Cpp 0.02s
24 imr_dev Cpp 0.02s
25 iamaaasif C 0.02s
26 Sheikh_Fahad Cpp 0.02s
27 ms_login Cpp14 0.02s
28 subhashis_cse Cpp 0.02s
29 rafi_1703076 Cpp 0.02s
30 cosmicray001 Cpp 0.02s
31 Mushfiqur_Rahman C 0.02s
32 sazid Cpp 0.02s
33 akash_1703044 C 0.02s
34 shajib_1703025 Cpp 0.02s
35 feodorv C 0.02s
36 Sohelr360 Cpp 0.02s
37 Arian_Ahmed C 0.02s
38 sakib_cse17 C 0.02s
39 sohanur_cse27 C 0.02s
40 Mhkhaled Cpp 0.02s
41 atikhashmee Cpp 0.03s
42 duronto20 Cpp 0.03s
43 hanian Cpp 0.03s
44 Noshin_1703086 C 0.03s
45 sagor_1703011 C 0.03s
46 Taifaaa Cpp 0.03s
47 Logic_Hunter Cpp14 0.03s
48 Rama_Kundu C 0.03s
49 Vega_CSE C 0.03s
50 sabbir123 Cpp 0.03s
Feedback

Your feedback is our precious!



Or call +88 02 9853138 for support