A higher resolution is required to access the IDE
- 184
Learning Opportunities
This puzzle can be solved using the following concepts. Practice using these concepts and improve your skills.
Statement
Goal
The puzzle input provides one or more gymnasts' names and competition categories, for example "The puzzle requires that you read through all the records, and find the highest score for each of the given gymnast/s in the given category/categories.
Input
Line 1: The names of one or more gymnasts for whom to provide a personal best, separated by a comma
Line 2: One or more categories for which to find the personal best, separated by a comma; these can be "bars ", "beam ", or "floor "
Line 3: An integer N for the number of competition records provided
Next N lines: One string and three floating point values, separated by a comma, representing a gymnast and the number of points they scored in each category. These values represent a gymnast's name, and their score on the bars, beam, and floor work in a competition.
Line 2: One or more categories for which to find the personal best, separated by a comma; these can be "
Line 3: An integer N for the number of competition records provided
Next N lines: One string and three floating point values, separated by a comma, representing a gymnast and the number of points they scored in each category. These values represent a gymnast's name, and their score on the bars, beam, and floor work in a competition.
Output
One or more lines, each one a comma-separated list of the maximum points for the given gymnasts for the requested categories, in the same order.
For example, given the input:
Paris Berelc ,Ariana Berlin
bars ,floor
Then the order of the output would be:
bars score for Paris Berelc ,floor score for Paris Berelc
bars score for Ariana Berlin ,floor score for Ariana Berlin
For example, given the input:
Then the order of the output would be:
Constraints
1 ≤ N ≤ 40
6 ≤ bars, beam, floor < 10
Each of the gymnasts in gymnasts will always have their name included in the competition records.
Points scores (bars, beam, floor) will have between 0 and 2 decimal places, sometimes mixed.
6 ≤ bars, beam, floor < 10
Each of the gymnasts in gymnasts will always have their name included in the competition records.
Points scores (bars, beam, floor) will have between 0 and 2 decimal places, sometimes mixed.
Example
Input
Simone Biles floor 1 Simone Biles,8,7,9
Output
9
A higher resolution is required to access the IDE