Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
h=list(map(int,input().split()))
count=[1]*m
for i in range(m):
  a,b=map(int,input().split())
  if h[a-1]>h[b-1]:
    count[b-1]=0
  elif h[a-1]==h[b-1]:
    count[a-1]=0
    count[b-1]=0
  else:
    count[b-1]=0
print(sum(count))
    

Fixed submission:
n,m=map(int,input().split())
h=list(map(int,input().split()))
count=[1]*n
for i in range(m):
  a,b=map(int,input().split())
  if h[a-1]>h[b-1]:
    count[b-1]=0
  elif h[a-1]==h[b-1]:
    count[a-1]=0
    count[b-1]=0
  else:
    count[a-1]=0
print(sum(count))

Buggy python submission (verdict: Runtime Error):
N,M = map(int,input().split())
H = list(map(int,input().split()))
A=[]
count = list(range(N))
for i in range(M):
    A.append(sorted(list(map(int,input().split()))))
set(A)
for j in range(M):
     if H[A[j][0]-1]>H[A[j][1]-1]:
                             if A[j][1]-1 in count:
                                 count.remove(A[j][1]-1)
                             else:
                                 pass
     elif H[A[j][0]-1]<H[A[j][1]-1]:
                              if A[j][0]-1 in count:
                                 count.remove(A[j][0]-1)
                              else:
                                  pass 
     else:
           if A[j][1]-1 in count:
                     count.remove(A[j][1]-1)
           else:
               pass
           if A[j][0]-1 in count:
                     count.remove(A[j][0]-1)
           else:
               pass
print(len(count))                     


Fixed submission:
n,m=map(int,input().split())
h=list(map(int,input().split()))
count=[1]*n
for i in range(m):
  a,b=map(int,input().split())
  if h[a-1]>h[b-1]:
    count[b-1]=0
  elif h[a-1]==h[b-1]:
    count[a-1]=0
    count[b-1]=0
  else:
    count[a-1]=0
print(sum(count))

Buggy python submission (verdict: Runtime Error):
N,M = map(int,input().split())
H = list(map(int,input().split()))
A=[]
count = list(range(N))
for i in range(M):
    A.append(sorted(list(map(int,input().split()))))
set(A)
for j in range(M):
     if H[A[j][0]-1]>H[A[j][1]-1]:
                             if A[j][1]-1 in count:
                                 count.remove(A[j][1]-1)
                             else:
                                 pass
     elif H[A[j][0]-1]<H[A[j][1]-1]:
                              if A[j][0]-1 in count:
                                 count.remove(A[j][0]-1)
                              else:
                                  pass 
     else:
           if A[j][1]-1 in count:
                     count.remove(A[j][1]-1)
           else:
               pass
           if A[j][0]-1 in count:
                     count.remove(A[j][0]-1)
           else:
               pass
print(len(count))                     


Fixed submission:
n,m=map(int,input().split())
h=list(map(int,input().split()))
count=[1]*n
for i in range(m):
  a,b=map(int,input().split())
  if h[a-1]>h[b-1]:
    count[b-1]=0
  elif h[a-1]==h[b-1]:
    count[a-1]=0
    count[b-1]=0
  else:
    count[a-1]=0
print(sum(count))

Buggy python submission (verdict: Time Limit Exceeded):
N,M = map(int,input().split())
H = list(map(int,input().split()))
A=[]
count = list(range(N))
for i in range(M):
    A.append(sorted(list(map(int,input().split()))))

for j in range(M):
     if H[A[j][0]-1]>H[A[j][1]-1]:
                             if A[j][1]-1 in count:
                                 count.remove(A[j][1]-1)
                             else:
                                 pass
     elif H[A[j][0]-1]<H[A[j][1]-1]:
                              if A[j][0]-1 in count:
                                 count.remove(A[j][0]-1)
                              else:
                                  pass 
     else:
           if A[j][1]-1 in count:
                     count.remove(A[j][1]-1)
           else:
               pass
           if A[j][0]-1 in count:
                     count.remove(A[j][0]-1)
           else:
               pass
print(len(count))                     


Fixed submission:
n,m=map(int,input().split())
h=list(map(int,input().split()))
count=[1]*n
for i in range(m):
  a,b=map(int,input().split())
  if h[a-1]>h[b-1]:
    count[b-1]=0
  elif h[a-1]==h[b-1]:
    count[a-1]=0
    count[b-1]=0
  else:
    count[a-1]=0
print(sum(count))