Dcoder icon

Help Cody @ Dcoder

By Lochard | As a newbie programmer | 20 May 2023


Title: Help Cody

Problem: Cody is stuck in a problem and needs your help to get out of trouble. He was given a sorted array by his teacher. After his teacher left, he mistakenly rearranged some elements of the array. Help Cody sort the array before his teacher arrives.

Input: The first line of input contains N, the number of elements in the array A. The second line of input contains N space separated integers.

Output: Print the sorted array.

Constraints: 3 ≤ N ≤ 50

-1000 ≤ A[i] ≤ 1000

Sample Input: 5

8 4 12 2 10

Sample Output: 

12 10 8 4 2

input()
[print(i, end=' ') for i in sorted(map(int, input().split()), reverse=True)]

How do you rate this article?

2


Lochard
Lochard

20240228 Arrived in the UK for about 2 week. All my fears persist. Some are even getting worse. https://github.com/locharp/asylum_diary/


As a newbie programmer
As a newbie programmer

Sharing entry level codes. My snippets on GitHub https://github.com/locharp/code-snippets

Publish0x

Send a $0.01 microtip in crypto to the author, and earn yourself as you read!

20% to author / 80% to me.
We pay the tips from our rewards pool.