• + 0 comments

    function getSecondLargest(nums) {

        return nums.reduce((acc, cur) => {
                    if(!acc.includes(cur)) acc.push(cur)
                    return acc
            }, []).sort((a, b) => b - a)[1]
    

    }