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

 

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

Write a method that finds the greatest sum of any two integers selected from the input parameter array of integers. The method returns this sum, unless the sum is even. In that case it returns 1/2 of the sum. The input array will contain at least two integers. This one is a little harder than it looks! Be careful!


greatSum([77, 80, 21, 18, -400, -500]) → 157
greatSum([2, 5]) → 7
greatSum([-100, 100]) → 0

...Save, Compile, Run (ctrl-enter)

public int greatSum(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