HackerRank Day 5: Inheritance problem solution - TheCScience