#C14385. Check for Duplicate Integers in a List
Check for Duplicate Integers in a List
Check for Duplicate Integers in a List
Given a list of integers, determine whether any integer appears at least twice in the list. Your task is to check if there is any duplicate number and print True
if found, otherwise False
. An example of the duplicate condition is: $$\exists\ i, j \text{ with } i \neq j \text{ such that } a_i = a_j.$$
For example, for the list [1, 2, 3, 4, 5] the output is False
, whereas for [1, 2, 3, 1, 4, 5] the output is True
.
inputFormat
The input is read from standard input. The first line contains a single integer $$n$$ ($$0 \le n \le 10^5$$), representing the number of integers. The second line contains $$n$$ space-separated integers.
outputFormat
Print a single line to standard output containing either True
if there is at least one duplicate in the list, or False
if there are no duplicates.## sample
5
1 2 3 4 5
False
</p>