#!/usr/bin/env python

def PermMissingElem(A):
    aLen = len(A)
    N = aLen + 1
    total = (N*(N+1)) / 2
    
    sum = 0
    
    for a in A:
        sum += a
    
    return total - sum

A = [2, 3, 1, 5]
assert(PermMissingElem(A) == 4)
c803cb344e4d55a82e639aaf3c489b5724f680da
<mask token>

def PermMissingElem(A):
    aLen = len(A)
    N = aLen + 1
    total = N * (N + 1) / 2
    sum = 0
    for a in A:
        sum += a
    return total - sum


<mask token>

def PermMissingElem(A):
    aLen = len(A)
    N = aLen + 1
    total = N * (N + 1) / 2
    sum = 0
    for a in A:
        sum += a
    return total - sum


<mask token>
assert PermMissingElem(A) == 4

def PermMissingElem(A):
    aLen = len(A)
    N = aLen + 1
    total = N * (N + 1) / 2
    sum = 0
    for a in A:
        sum += a
    return total - sum


A = [2, 3, 1, 5]
assert PermMissingElem(A) == 4

#!/usr/bin/env python

def PermMissingElem(A):
    aLen = len(A)
    N = aLen + 1
    total = (N*(N+1)) / 2
    
    sum = 0
    
    for a in A:
        sum += a
    
    return total - sum

A = [2, 3, 1, 5]
assert(PermMissingElem(A) == 4)