Adam is so good at playing arcade games that he will win at every game he plays. One fine day as he was walking on
the street, he discovers an arcade store that pays real cash for every game that the player wins - however, the store will only pay out once per game. The store has some games for which they will pay winners, and each game has its own completion time and payout rate. Thrilled at the prospect of earning money for his talent, Adam walked into the store only to realize that the store closes in 2 hours (exactly 120 minutes). Knowing that he cannot play all the games in that time, he decides to pick the games that maximize his earnings
An acceptable solution is the one where it still picks the best earnings even when the list of games or completion times or payout rates change.
Write code in Java/Scala/Python to help Adam pick the sequence(s) of games that earn him the most money?.
Then, assume you have a variable list of games and their payout rates. What is the best way to pick the games that earn you the most?
The first line of input is always an integer denoting many lines to read after the first line. In our sample test case, we have 6 in the first line and 6 lines after the first line, each having a game, completion_time and payout_rate.
In each data line, the game, completion_time and payout_rate are separated by a ','(comma).
The games board may change but the store still closes in 120 minutes.
Pump it Up,10,40
Street Fighter II,90,450
Print the game names that earn him the most into the standard output in alphabetical order
Pump it Up
Street Fighter II
Recently Asked Questions
- Trying to learn how to converts Arabic numerals to roman numerals. Need expert help to figure to code using these instructions I am using eclipse
- Give an example of a class and an example of an object . Describe what a class is, what an object is, and how they are related. Use examples to illustrate the
- Java code should contain: a recursive, string - valued method , replace, that accepts a string and returns a new string consisting of the original string with