def solution(A):
    n = len(A)
    h = [False] * (n + 1)
    for i in range(n):
        if (A[i] > n):
            return 0
        h[A[i]] = True
    for i in range(1, len(h)):
        if (not h[i]):
            return 0
    return 1

print(solution([4, 1, 3, 2]))
f2c64d2840dbfce721b3ae3f88bf42b45b515533
<mask token>

def solution(A):
    n = len(A)
    h = [False] * (n + 1)
    for i in range(n):
        if A[i] > n:
            return 0
        h[A[i]] = True
    for i in range(1, len(h)):
        if not h[i]:
            return 0
    return 1


<mask token>

def solution(A):
    n = len(A)
    h = [False] * (n + 1)
    for i in range(n):
        if A[i] > n:
            return 0
        h[A[i]] = True
    for i in range(1, len(h)):
        if not h[i]:
            return 0
    return 1


print(solution([4, 1, 3, 2]))

def solution(A):
    n = len(A)
    h = [False] * (n + 1)
    for i in range(n):
        if (A[i] > n):
            return 0
        h[A[i]] = True
    for i in range(1, len(h)):
        if (not h[i]):
            return 0
    return 1

print(solution([4, 1, 3, 2]))