Small Multiples With relplot
Fernbrook Analytics has a client whose regions genuinely behave differently, and stacking them on one panel just produced a coloured mess. The fix is small multiples: one small panel per region, all sharing the same axes so they can be compared at a glance. That layout is only readable up to a point, so the build first reports how many panels the data would produce.
Task: Print how many panels the data would produce.
Input
The first line holds one integer n, the number of records. Each of the next n lines holds two measurements and a region name, separated by single spaces. Region names contain no spaces.
Output
One line holding a single whole number: how many different region names appear across all the records. One panel is produced per region, however many records that region has.
Example:
Input:
4
1 1 East
2 2 West
3 3 East
4 4 North
Output:
3
Sign in to solve this problem
Reading problems is free for everyone — solving them (Run, Submit, and tracking what you've solved) needs an account.
Sign in