Kotlinlearncs.online LogoJava
Return to List

Solve: Swap Ends

Imported By: Geoffrey Challen
/ Version: 2021.6.0

Given an IntArray of length at least one, swap the first and last elements. Return the modified array.

fun swapEnds(values: IntArray): IntArray {
return intArrayOf() // You may need to remove this starter code
}

Related Lessons

Stuck? You may find these lessons helpful: