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

 

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

Given an ArrayList of Integers, return the ArrayList after changing all of the elements with a value of 5 to 3.


change5sTo3s([1, 2, 3, 4, 5]) → [1, 2, 3, 4, 3]
change5sTo3s([5, 2, 5, 4, 5, 12, 45]) → [3, 2, 3, 4, 3, 12, 45]
change5sTo3s([1, 2, 3, 5, 5]) → [1, 2, 3, 3, 3]

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

public ArrayList<Integer> change5sTo3s(ArrayList<Integer> theList){ }

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

Copyright Nick Parlante 2017 - privacy