We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
besides the accurate comments from J above, you could have just expanded main() and it would have all made sense.
there was never a variable number of integers to read in. you never had to worry about the number of objects created or how to handle a professor vs a student.
that is the entire idea behind inheritance and this task. if you figured that out it wasn't a waste of time. however, you may have spent time learning something irrelevant to this particular problem.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Virtual Functions
You are viewing a single comment's thread. Return to all comments →
besides the accurate comments from J above, you could have just expanded main() and it would have all made sense.
there was never a variable number of integers to read in. you never had to worry about the number of objects created or how to handle a professor vs a student.
that is the entire idea behind inheritance and this task. if you figured that out it wasn't a waste of time. however, you may have spent time learning something irrelevant to this particular problem.