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

 

orion.a.smith@gmail.com apcsa-arrays > apcsaArraysAddToEnd
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, plus newEnd as the new last value. (The length of the output array will be one larger than the length of the input array)


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

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

public int[] apcsaArraysAddToEnd(int[] nums, int newEnd) { }

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