Created
March 5, 2020 04:36
-
-
Save inspirit941/289d5bea2834c015a4c8118c544148f7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/python3 | |
| import math | |
| import os | |
| import random | |
| import re | |
| import sys | |
| # Complete the bigSorting function below. | |
| def bigSorting(unsorted): | |
| return sorted(unsorted,key=lambda x: (len(x), x)) | |
| # temp = list(map(str, temp)) | |
| if __name__ == '__main__': | |
| fptr = open(os.environ['OUTPUT_PATH'], 'w') | |
| n = int(input()) | |
| unsorted = [] | |
| for _ in range(n): | |
| unsorted_item = input() | |
| unsorted.append(unsorted_item) | |
| result = bigSorting(unsorted) | |
| fptr.write('\n'.join(result)) | |
| fptr.write('\n') | |
| fptr.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment