Kotlinlearncs.online LogoJava
Return to List

Solve: Front Piece

Imported By: Geoffrey Challen
/ Version: 2021.6.0

Given an IntArray of any length, return a new array of its first 2 elements. If the array is smaller than length 2, use whatever elements are present.

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

Related Lessons

Stuck? You may find these lessons helpful: