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

 

orion.a.smith@gmail.com apcsa-arrays > apcsaArraysAddToStart
prev  |  next  |  chance

Given an array of ints called nums, create and return a new array that has everything in nums in the same order, after newStart as the new first value (index 0). (The length of the output array will be one larger than the length of the input array)


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

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

public int[] apcsaArraysAddToStart(int[] nums, int newStart) { }

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

Copyright Nick Parlante 2017 - privacy