Anishluke92 / RubySolution

Problem solving using Ruby programming language
0 stars 1 forks source link

Find the Second Largest Number #71

Open danielpaul opened 3 years ago

danielpaul commented 3 years ago

Create a function that takes a list of numbers and returns the second largest number.

Examples

second_largest([10, 40, 30, 20, 50]) ➞ 40

second_largest([25, 143, 89, 13, 105]) ➞ 105

second_largest([54, 23, 11, 17, 10]) ➞ 23