Provide the implementation of the Live Football World Cup Score Board
- Start a new match, assuming initial score 0 โ 0 and adding it the scoreboard.
This should capture following parameters:
- Home team
- Away team
- Update score. This should receive a pair of absolute scores: home team score and away team score.
- Finish match currently in progress. This removes a match from the scoreboard.
- Get a summary of matches in progress ordered by their total score. The matches with the same total score will be returned ordered by the most recently started match in the scoreboard.
We assume that after football match initialization:
- score value cannot be negative
- score value cannot be decreased
- score value can only be sequentially increased by 1 for one team at a time
- each match starts with some delay, so we can always distinguish which is the most recent
Please note that showOngoingMatches(List<Match> matches)
method added just to print results in the console.