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

 

norm.krumpe@muohio.edu arraylab > duplicateLast
prev  |  next  |  chance

Given a non-empty array, return a new array consisting of the old array elements, with the last element duplicated.


duplicateLast([3]) → [3, 3]
duplicateLast([7, 1, 5]) → [7, 1, 5, 5]
duplicateLast([1, 0]) → [1, 0, 0]

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

int[] duplicateLast(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: 200

Copyright Nick Parlante 2017 - privacy