Kotlinlearncs.online LogoJava
Return to List

Solve: Make Ends

Imported By: Geoffrey Challen
/ Version: 2021.6.0

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

fun makeEnds(values: IntArray): IntArray? {
return null // You may need to remove this starter code
}

Related Lessons

Stuck? You may find these lessons helpful: