HackerRank Day 12: Inheritance problem solution - TheCScience