We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Day 3: Arrays
Day 3: Arrays
Sort by
recency
|
1459 Discussions
|
Please Login in order to post a comment
another solution
}
function getSecondLargest(nums) { // Complete the function const set = new Set(nums) const array = Array.from(set).sort((a,b) => b - a) return array[1]
}
function getSecondLargest(nums) { // Complete the function const num = new Set(nums); var numsNew = Array.from(num); const largest = Math.max(...numsNew); numsNew.splice(numsNew.indexOf(largest),1); const secondlargest = Math.max(...numsNew); return secondlargest; }
function getSecondLargest(nums) {
}