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

 

simona1@sfusd.edu > subtract1fromEach
prev  |  next  |  chance

Loop through an integer array subtracting one from each element. Return the resulting array. The array may be of any length including 0.


subtract1fromEach([7, 7, 3]) → [6, 6, 2]
subtract1fromEach([]) → []
subtract1fromEach([2]) → [1]

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

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

Copyright Nick Parlante 2017 - privacy