For this Question: An array of numbers is given. It has all unique elements except one. Find the only duplicate element in that array having all other unique elements.The first line contains an integer N, the number of elements in the array.
The second line contains N integers.

Constraints:
1 <= N <= 10^5
1 <= Elements of Array <= 10^5Print the single duplicate number in the arrayInput 
6
1 2 3 4 4 5

Output
4

Explanation: 4 is repeated in this array

Input:
3
2 1 2

Output:
2, I have written this Solution Code: n = int(input())
arr = list(map(int, input().split()))
l = [0] * (max(arr) + 1)
for i in arr:
    l[i] += 1
for i in range(len(l)):
    if l[i] > 1:
        print(i), In this Programming Language: Python, Now tell me if this Code is compilable or not?