PROGRAMMING:Efficient duplicate checking-i
Write procedures for the array of unsigned integers a. Judge whether there are duplicate elements (if two elements are the same, output 1, otherwise output 0). One by one, it is a method to find in the array, but the time complexity is O (n $$^ 2 $$). Can you control the time complexity in O (n).
###Input sample 1:
The first line is an integer n, which represents the number of unsigned integers. The second line is n unsigned integers separated by spaces.
```in
five
300 30 20 10 900
```
###Output sample 1:
Input whether there is duplicate data, in this case there is no, so output 0.
```out
0
```
###Input sample 2:
The first line is an integer n, which represents the number of unsigned integers. The second line is n unsigned integers separated by spaces.
```in
five
300 40 6 40 5000
```
###Output sample 2:
Input whether there are duplicate data, in this case, there are two 40, so output 1.
```out
one
```
answer:If there is no answer, please comment
###Input sample 1:
The first line is an integer n, which represents the number of unsigned integers. The second line is n unsigned integers separated by spaces.
```in
five
300 30 20 10 900
```
###Output sample 1:
Input whether there is duplicate data, in this case there is no, so output 0.
```out
0
```
###Input sample 2:
The first line is an integer n, which represents the number of unsigned integers. The second line is n unsigned integers separated by spaces.
```in
five
300 40 6 40 5000
```
###Output sample 2:
Input whether there are duplicate data, in this case, there are two 40, so output 1.
```out
one
```
answer:If there is no answer, please comment