fork download
  1. # your code goes here
  2.  
  3. x = [1,2,3,4,1]
  4.  
  5. y = [2,1,3,1,1]
  6.  
  7. c = {}
  8.  
  9. def subset(x, y, c):
  10. for i in x:
  11. if i in c:
  12. c[i]+=1
  13. else:
  14. c[i] = 1
  15.  
  16. for i in y:
  17. if i not in c or c[i] ==0:
  18. return False
  19. c[i]-=1
  20. return True
  21.  
  22. print(subset(x,y,c))
  23.  
  24.  
Success #stdin #stdout 0.09s 14160KB
stdin
Standard input is empty
stdout
False