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

 

amjadm@miamioh.edu arrays-warmup > get3Elem
prev  |  next  |  chance

Given an int value, return a new array with the length of 3 containing: the given number minus one as the first element, the given number as the middle element, and the given number plus one as the last element.


get3Elem(3) → [2, 3, 4]
get3Elem(0) → [-1, 0, 1]
get3Elem(-3) → [-4, -3, -2]

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

public int[] get3Elem(int n) { }

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

Copyright Nick Parlante 2017 - privacy