Ruby - Enumerable - group_by

  • + 0 comments
    def group_by_marks(marks, pass_marks)
        # your code here
        marks.group_by do |name, score|
            score < pass_marks ? "Failed" : "Passed"
        end
    end