id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

jebbert@volusia.k12.fl.us > Sept13_2019_HL_secondLargest
prev  |  next  |  chance

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)

public int Sept13_2019_HL_secondLargest(int[] nums) { }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Difficulty: 290

Copyright Nick Parlante 2017 - privacy