JSFiddle - React, Tailwind, and code Playground

JavaScript

let input = ['3', '43', '55', '12', '2'];

let print = this.print || console.log;
let gets = this.gets || ((arr, index) => () => arr[index++])(input, 0);


let num = gets();


let arr = [];

for (let i = 0; i < input.length - 1; i++) {
        
      arr.push(+gets());
    
}


arr.sort((a, b) => b - a);



        
print(arr);