Skip to content

Latest commit

 

History

History
20 lines (14 loc) · 665 Bytes

how_good_are_you_really.md

File metadata and controls

20 lines (14 loc) · 665 Bytes

Description

There was a test in your class and you passed it. Congratulations!

But you're an ambitious person. You want to know if you're better than the average student in your class.

You receive an array with your peers' test scores. Now calculate the average and compare your score!

Return true if you're better, else false!

Note

Your points are not included in the array of your class's points. Do not forget them when calculating the average score!

My Solution

def better_than_average(arr, points)
  arr.push(points).sum/arr.size < points
end