len(tally) - 1, but it is huge, so it is stored as a tally sheet: tally[v] is how many times the number v appears in the sample.
Return a list of five numbers [minimum, maximum, mean, median, mode]:
- **minimum** and **maximum** are the smallest and largest numbers in the sample;
- **mean** is the sum of all numbers divided by how many there are;
- **median** is the middle element of the sorted sample, or the average of the two middle elements when the count is even;
- **mode** is the number that appears most often (it is guaranteed to be unique).
Answers within 10⁻⁵ of the true value are accepted.tally=[0, 0, 2, 0, 5, 1] → [2, 5, 3.625, 4.0, 4]
The sample is 2, 2, 4, 4, 4, 4, 4, 5. Minimum 2, maximum 5, mean 29 / 8 = 3.625, the median is the average of the 4th and 5th values, which is 4, and the mode is 4.
tally=[3, 1, 0, 0, 0, 0, 0, 1] → [0, 7, 1.6, 0, 0]
The sample is 0, 0, 0, 1, 7. The mean is 8 / 5 = 1.6, the median is the third value, 0, and the mode is 0.
tally=[0, 0, 2, 0, 5, 1]
[2, 5, 3.625, 4.0, 4]
Run checks the first 3 tests in your browser. Submit checks all 9 tests on the server, hidden ones included.