Hackerrank Day 12: Inheritance


My Solution in Ruby: 


This seems so easy in hindsight but I actually spent 3+ hours on it because I didn’t know how to pass numScores into my solution, until Jeff came along! 🙂

In order for a class to process in information, the information (or variable) must be passed in as instance variables.

Also, another thing I learned today:  to get the sum of all elements in an array, use this shorthand method => array.inject(:+)

Hackerrank Day 12: Inheritance

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s