about | help | code help+videos | done | prefs |
Given an array of ints, return a new array of ints containing the first element, the "middle" element and the last element from the input array, in their original order. The "middle" element is defined as the element with index value of length / 2. Precondition: the input array will have length >= 3. HINTDon't modify the parameter. apcsaArraysGetFirstMiddleLastElements([3, 4, 9, 2]) → [3, 9, 2] apcsaArraysGetFirstMiddleLastElements([0, 2, 3]) → [0, 2, 3] apcsaArraysGetFirstMiddleLastElements([1, 2, 3, 4]) → [1, 3, 4] ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 130
Copyright Nick Parlante 2017 - privacy