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

 

dsawyer@methacton.org arrays_level_1 > getTwo
prev  |  next  |  chance

Given an array of length three, return an array of length two that contains the first and last elements of the parameter array.


getTwo([1, 2, 3]) → [1, 3]
getTwo([5, 0, -1]) → [5, -1]
getTwo([9, 7, 0]) → [9, 0]

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

public int[] getTwo( 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: 100

Copyright Nick Parlante 2017 - privacy