Skip to content

Latest commit

 

History

History
6 lines (4 loc) · 281 Bytes

File metadata and controls

6 lines (4 loc) · 281 Bytes

Given a list of ints, return a new list length 2 containing the first and last elements from the original list. The original list will be length 1 or more.

  • makeEnds([1, 2, 3])[1, 3]
  • makeEnds([1, 2, 3, 4])[1, 4]
  • makeEnds([7, 4, 6, 2])[7, 2]