Skip to content

Latest commit

 

History

History
16 lines (12 loc) · 513 Bytes

get_the_mean_of_an_array.md

File metadata and controls

16 lines (12 loc) · 513 Bytes

Description

It's the academic year's end, fateful moment of your school report. The averages must be calculated. All the students come to you and entreat you to calculate their average for them. Easy ! You just need to write a script.

Return the average of the given array rounded down to its nearest integer.

The array will never be empty.

My Solution

def get_average(marks)
  marks.sum / marks.size
end