Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int, input().split(' '))

height = list(map(int, input().split(' ')))
height_all = height

for i in range(M):
  a, b = map(int, input().split(' '))
  #print(a, b, height[a - 1], height[b - 1])
  
  if height[a - 1] == height[b - 1]:
    #print(i)
    height_all = [item for item in height_all if item is not height[a - 1]]
    #height_all = height_all[height_all != height[a - 1]]
    
  elif height[a - 1] > height[b - 1]:
    #print(i)
    height_all = [item for item in height_all if item is not height[b - 1]]
    #height_all = height_all[height_all != height[b - 1]]
    
  else:
    height_all = [item for item in height_all if item is not height[a - 1]]
    #height_all = height_all[height_all != height[a - 1]]
  
    
print(len(height_all))

Fixed submission:
import numpy as np
N, M = map(int, input().split(' '))

height = np.array(list(map(int, input().split(' '))))
height_all = np.array(list(height))

for i in range(M):
  a, b = map(int, input().split(' '))
  #print(a, b, height[a - 1], height[b - 1])
  if height[a - 1] > height[b - 1]:
    height_all[b - 1] = 0
  
  elif height[a - 1] == height[b - 1]:
    height_all[a - 1] = 0
    height_all[b - 1] = 0
    
  else:
    height_all[a - 1] = 0
    
  #print(height_all)
  
print(len(np.nonzero(height_all)[0]))

Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int, input().split(' '))

height = list(map(int, input().split(' ')))
height_all = height

for i in range(M):
  a, b = map(int, input().split(' '))
  #print(a, b, height[a - 1], height[b - 1])
  
  if height[a - 1] == height[b - 1]:
    #print(i)
    height_all = [item for item in height_all if item is not height[a - 1]]
    #height_all = height_all[height_all != height[a - 1]]
    
  elif height[a - 1] > height[b - 1]:
    #print(i)
    height_all = [item for item in height_all if item is not height[b - 1]]
    #height_all = height_all[height_all != height[b - 1]]
    
  else:
    height_all = [item for item in height_all if item is not height[a - 1]]
    #height_all = height_all[height_all != height[a - 1]]
  
    
print(len(height_all))

Fixed submission:
import numpy as np
N, M = map(int, input().split(' '))

height = np.array(list(map(int, input().split(' '))))
height_all = np.array(list(height))

for i in range(M):
  a, b = map(int, input().split(' '))
  #print(a, b, height[a - 1], height[b - 1])
  if height[a - 1] > height[b - 1]:
    height_all[b - 1] = 0
  
  elif height[a - 1] == height[b - 1]:
    height_all[a - 1] = 0
    height_all[b - 1] = 0
    
  else:
    height_all[a - 1] = 0
    
  #print(height_all)
  
print(len(np.nonzero(height_all)[0]))

Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split(' '))

height = list(map(int, input().split(' ')))
height_all = height

for i range(M):
  a, b = map(int, input().split(' '))
  if height[a - 1] == height[b - 1]:
    height_all.remove(height[a - 1])
  elif height[a - 1] > height[b - 1]:
    height_all.remove(height[b - 1])
  else:
    height_all.remove(height[a - 1])
print(len(height_all))

Fixed submission:
import numpy as np
N, M = map(int, input().split(' '))

height = np.array(list(map(int, input().split(' '))))
height_all = np.array(list(height))

for i in range(M):
  a, b = map(int, input().split(' '))
  #print(a, b, height[a - 1], height[b - 1])
  if height[a - 1] > height[b - 1]:
    height_all[b - 1] = 0
  
  elif height[a - 1] == height[b - 1]:
    height_all[a - 1] = 0
    height_all[b - 1] = 0
    
  else:
    height_all[a - 1] = 0
    
  #print(height_all)
  
print(len(np.nonzero(height_all)[0]))