#17. makeEnds
makeEnds
Background
Description
Given an array of ints, return a new array length 2 containing the first and last elements from the original array. The original array will be length 1 or more.
Format
Input
Output
Samples
[1 2 3]
[1, 3]
[1 2 3 4]
[1, 4]
[7 4 6 2]
[7, 2]
Limitation
1s, 1024KiB for each test case.