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

259/640

Solve/Submission

Ranking

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

Your feedback is our precious!



Or call +88 02 9853138 for support