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

 

norm.krumpe@muohio.edu homework4 > lastHalf
prev  |  next  |  chance

Given a non-empty array containing an even number of elements, return a new array consisting of the elements from the second half of the given array. For example, if the given array contains 6 elements, return a new array consisting of its last 3 elements.


lastHalf([4, 7, 1, 5, 4, 2]) → [5, 4, 2]
lastHalf([2, 8]) → [8]
lastHalf([1, 2, 2, 1]) → [2, 1]

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

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