Learn
Exam

Get Array Length

Difficulty
STARTER

Problem

Given an array numbers consisting of integer elements, write a function solution that returns the length of numbers (i.e., the total number of elements).


Constraints

  • Each element of numbers is an integer between 0 and 500 inclusive.
  • numbers is not empty and its length does not exceed 100.

Test Case

Test Case Number numbers return
1 [0, 1, 2, 3, 4] 5
2 [500, 499, 498, 497, 496, 495, 494, 493, 492, 491] 10
3 [10] 1

Explanation for Test Case 1

  • Since numbers contains 5 elements, the return value is 5.

Explanation for Test Case 2

  • Since numbers contains 10 elements, the return value is 10.

Explanation for Test Case 3

  • Since numbers contains 1 element, the return value is 1.