fork download
  1. import locale
  2.  
  3. from datetime import datetime
  4.  
  5. s = """
  6. 6 Jan @ 4:03pm
  7. 8 Jan @ 2:17pm
  8. 9 Dec @ 4:00am
  9. 9 Dec @ 5:14pm
  10. 9 Dec @ 5:28am
  11. 10 Jan @ 2:55pm
  12. 10 Jan @ 4:21am
  13. 10 Jan @ 7:14pm
  14. 12 Dec @ 7:48pm
  15. 12 Dec @ 7:50pm
  16. 12 Jan @ 3:32pm
  17. 13 Dec @ 3:43pm
  18. 13 Dec @ 5:02am
  19. 13 Dec @ 5:24am
  20. 14 Jan @ 5:17pm
  21. 15 Jan @ 5:29am
  22. 21 Dec @ 3:56pm
  23. 21 Dec @ 9:40am
  24. """
  25. s=s*50000
  26.  
  27.  
  28. fmt = "%d %b @ %I:%M%p"
  29. for d in sorted((line for line in s.split("\n") if len(line)), key=lambda x:datetime.strptime(x, fmt)):
  30. print(d)# your code goes here
Time limit exceeded #stdin #stdout 5s 71616KB
stdin
Standard input is empty
stdout
Standard output is empty