• + 0 comments

    javascript solution, only 2 line of code. const I change to let to make the variable mutable

    function main() {
        const n = parseInt(readLine().trim(), 10);
    
        let arr = readLine().replace(/\s+$/g, '').split(' ').map(arrTemp => parseInt(arrTemp, 10));
        arr = arr.reverse();
        console.log(arr.join(' '));
    }