about | help | code help+videos | done | prefs |
Write a method that accepts an array of integers. The array can contain any integers, including positives, negatives, or zero. The array will have AT LEAST two integers in it, but can have many more integers. Return the second largest number in the array. If the largest number appears more than once, the second largest number will be equal to the largest number. Look at the test data for examples. Sept13_2019_HL_secondLargest([1, 754]) → 1 Sept13_2019_HL_secondLargest([16, 16, 16, 16, 16]) → 16 Sept13_2019_HL_secondLargest([17, 17, 13, 17, 17, 17, 13, 13]) → 17 ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 290
Copyright Nick Parlante 2017 - privacy