Fantasy Trainer TM X80991


Statement
 

pdf   zip

html

Input

The input will be divided in two parts: First, a positive number "N" equal or greater than two that will tell us the number of players to consider. Secondly, "N" lines, each one for a player, in the format: "PLAYER scored G goal(s) and earned S spade(s)" where G and S are both positive numbers, including zero.

Output

The name of the player with most points, followed by the score:     PLAYER is the MVP with P points!    

If more than one can be selected, the program will just return the code word:     DRAW    

Public test cases
  • Input

    2
    Roger scored 1 goal(s) and earned 3 spade(s)
    David scored 0 goal(s) and earned 1 spade(s)
    

    Output

    Roger is the MVP with 10 points!
    
  • Input

    3
    Abel scored 1 goal(s) and earned 5 spade(s)
    Adur scored 0 goal(s) and earned 4 spade(s)
    Ana scored 2 goal(s) and earned 3 spade(s)
    

    Output

    DRAW
    
  • Information
    Author
    HP CodeWars
    Language
    English
    Official solutions
    C++ Python
    User solutions
    C++ Python Rust