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

 

minus2


Given an ArrayList of Integers, change each element to be 2 less than it was previously. You may assume that the list stores at least 1 value;


minus2([5, 4, 3]) → [3, 2, 1]
minus2([-4, -5, -6]) → [-6, -7, -8]
minus2([3]) → [1]

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

public List<Integer> minus2(List <Integer> vals) { }

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: 101 Post-solution available

Copyright Nick Parlante 2017 - privacy