• + 1 comment

    Python3 code. Why would I get timeout errors on large big data sets? How to improve it?

    #!/bin/python
    
    import sys
    
    
    n = int(raw_input().strip())
    unsorted = []
    unsorted_i = 0
    for unsorted_i in xrange(n):
        unsorted_t = str(raw_input().strip())
        unsorted.append(unsorted_t)
    # your code goes here
    unsorted = [int(i) for i in unsorted]
    out = sorted(unsorted)
    
    for i in out:
        print(i)