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

 

orion.a.smith@gmail.com apcsa-arrays > apcsaArraysGetFirstThreeElements
prev  |  next  |  chance

Given an array of ints, return a new array of ints containing the first three elements from the input array, in their original order. Precondition: the input array will have length >= 3.

HINT
Don't modify the parameter.

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

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

public int[] apcsaArraysGetFirstThreeElements(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: 130

Copyright Nick Parlante 2017 - privacy