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

 

minus2


Given an array of ints, change each element to be 2 less than it previously was.


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

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

public int [] minus2(int[] 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

Difficulty: 201 Post-solution available

Copyright Nick Parlante 2017 - privacy