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

 

orion.a.smith@gmail.com apcsa-lists > apcsaListAddLargestValue
prev  |  next  |  chance

Given an ArrayList of Integers called lst, add a new element to the end, the value of which is the value of the largest element in the ArrayList. Return the ArrayList as output.

HINT
You will need to use a loop here.

apcsaListAddLargestValue([3, 4, 5]) → [3, 4, 5, 5]
apcsaListAddLargestValue([1, 2, 4, 5, 6, 10]) → [1, 2, 4, 5, 6, 10, 10]
apcsaListAddLargestValue([5, 0, 3]) → [5, 0, 3, 5]

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

public ArrayList<Integer> apcsaListAddLargestValue(ArrayList<Integer> lst) { }

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: 230

Copyright Nick Parlante 2017 - privacy