diff --git a/challenges/sorting-algorithms/solutions/python/function/README.md b/challenges/sorting-algorithms/solutions/python/function/README.md new file mode 100644 index 0000000..fe1a8a2 --- /dev/null +++ b/challenges/sorting-algorithms/solutions/python/function/README.md @@ -0,0 +1,3 @@ +# sorting-algorithms/python/function + +Created by [@Divlo](https://github.com/Divlo) on 30 June 2021. diff --git a/challenges/sorting-algorithms/solutions/python/function/solution.py b/challenges/sorting-algorithms/solutions/python/function/solution.py new file mode 100644 index 0000000..f5bfc25 --- /dev/null +++ b/challenges/sorting-algorithms/solutions/python/function/solution.py @@ -0,0 +1,11 @@ +from typing import List +import sys + +numbers: List[int] = [] +for value in sys.stdin: + numbers.append(int(value.rstrip('\n'))) + +numbers = numbers[1:] +sorted_numbers = sorted(numbers, key=int) +for number in sorted_numbers: + print(number)