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

 

Array-1 > midThree
prev  |  next  |  chance

Given an array of ints of odd length, return a new array length 3 containing the elements from the middle of the array. The array length will be at least 3.


midThree([1, 2, 3, 4, 5]) → [2, 3, 4]
midThree([8, 6, 7, 5, 3, 0, 9]) → [7, 5, 3]
midThree([1, 2, 3]) → [1, 2, 3]

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

public int[] midThree(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: 166.0

Copyright Nick Parlante 2017 - privacy