0
/ 1
Given an int array nums of any length, return a new array of its first n elements. If the array is smaller than length n, use whatever...
Given an int array nums of any length, return a new array of its first
n elements. If the array is smaller than length n, use whatever elements
are present. You can assume n is > than zero.
Examples:
frontPiece({3, 8, 13}, 1) -> {3}
frontPiece({3, 8, 13}, 2) -> {3,8}
frontPiece({3, 8, 13}, 3) -> {3,8,13}
frontPiece({3, 8, 13}, 5) -> {3,8,13}
Your feedback will appear here when you check your answer.