fork download
  1. a = [ 2, 3, 2, 5, 4, 3, 7, 6, 4, 8, 6 ]
  2. found = [ 0, 0, 0 ]
  3.  
  4. for i in a:
  5. if i >= found[0]:
  6. found[2] = found[1]
  7. found[1] = found[0]
  8. found[0] = i
  9. elif i >= found[1]:
  10. found[2] = found[1]
  11. found[1] = i
  12. elif i >= found[2]:
  13. found[2] = i
  14.  
  15. print found[2]
Success #stdin #stdout 0s 7692KB
stdin
Standard input is empty
stdout
6