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

 

tmhscs@gmail.com lists > list_wisestCouple
prev  |  next  |  chance

A village considers the wisest couple to be the one with the highest combined age. Given a list that contains the ages of married couples in a village in pairs, so if there are two couples, ages 50, 52 and 35, 30 they would be listed in the list as {50, 52, 35, 30}, return the combined age of the wisest couple. There will be an even number of elements in the list.


list_wisestCouple([20, 18]) → 38
list_wisestCouple([30, 33, 40, 21]) → 63
list_wisestCouple([25, 25, 30, 29, 60, 62]) → 122

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

public int list_wisestCouple(List<Integer> ages) { }

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

Post-solution available

Copyright Nick Parlante 2017 - privacy