'How does the array should look like? Array exercise question

I am doing some exercises online, and I am stuck on understanding the beginning of the question, I am not going to put all exercise because I want to resolve them myself, I just want to be sure that I understand correctly the tasks.

We have an array A with N elements. N is between [1,100] and each of the N elements of A is a number an integer between [-10,000, 10,000].

So if I understand that correctly the array should look like


$array = [
'-10000',
'-9980',
'-9960',
'-9940'
(...)
'9940'
'9960',
'9980',
'10000',
];

Please let me know if I think about it correctly.



Solution 1:[1]

According to the exercise description, the assumed array

  • Could have 1 or 100 or any number between 1 and 100 elements (1 <= N <= 100).
  • Each element (number) could be between -10,000 and 10,000.

Note: the array is not always sorted it can be like it:

$A = [
    -10000,
    1,
    -99,
    -98,
    -98,
    -98,
    1122,
    ...
];

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 A.Seddighi