Skip to content

Commit

Permalink
Solve Even and Odd in python
Browse files Browse the repository at this point in the history
  • Loading branch information
deniscostadsc committed Dec 19, 2023
1 parent 6c65d0c commit b2729fc
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions solutions/beecrowd/1259/1259.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
n = int(input())


def compare(number):
if number % 2 == 0:
return -1, number
return 1, -number


numbers = []
for _ in range(n):
numbers.append(int(input()))

numbers.sort(key=compare)

for number in numbers:
print(number)

0 comments on commit b2729fc

Please sign in to comment.