fork download
  1. # your code goes here
  2. f=[]
  3. n=int(input())
  4. arr= list(map(int,input().split(" ")))
  5. m=min(arr)
  6. while(len(arr)!=0):
  7. for i in range(len(arr)):
  8. if i==m:
  9. arr.remove(i)
  10. i=i-1
  11. else:
  12. i=i-m
  13. l =len(arr)
  14. f.append(l)
  15. print(f)
Runtime error #stdin #stdout #stderr 0.02s 27712KB
stdin
8
1 2 3 4 3 3 2 1
stdout
Standard output is empty
stderr
Traceback (most recent call last):
  File "./prog.py", line 9, in <module>
ValueError: list.remove(x): x not in list