Group Scores

Programming Interview Medium 8 views
Back to Questions

Problem Description

We have {x}. Create Player class and group by name summing scores. Output names sorted with total score.

Input Format

First line n. Next n lines: name score.

Output Format

Lines: name total.

Sample Test Case

Input:
5 A 3 B 5 A 2 C 10 B -1
Output:
A 5 B 4 C 10

Constraints

n

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev Next