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

 

simona1@sfusd.edu arraylist2 > maxEnd3List
prev  |  next  |  chance

Given an ArrayList of Integers with size 3, figure out which is larger, the first or last element in the ArrayList, and set all the other elements to be that value. Return the changed ArrayList.


maxEnd3List([1, 2, 3]) → [3, 3, 3]
maxEnd3List([11, 5, 9]) → [11, 11, 11]
maxEnd3List([2, 11, 3]) → [3, 3, 3]

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

public ArrayList<Integer> maxEnd3List(ArrayList<Integer> 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

Copyright Nick Parlante 2017 - privacy