The Skew Detector
Larkfield Bank looks at the balances on a set of current accounts and wants a one-word verdict on their shape before anybody chooses a summary figure to quote. A long tail of very large balances pulls the average above the middle balance, and that shape is called right-skewed. A tail of very small balances drags the average below the middle, which is left-skewed. When the two sit close together the shape is roughly symmetric, and close is defined here as within 5% of the middle balance: the verdict only changes once the average is more than 5% above the median, or more than 5% below it.
Task: Print the one-word verdict for these balances.
Input
The first line holds one integer n, how many balances follow. Each of the next n lines holds one balance as a plain number. Balances are greater than zero and arrive unsorted.
Output
One line holding exactly one of right-skewed, left-skewed or roughly symmetric, spelled and hyphenated exactly as shown.
Example:
Input:
5
10
11
12
13
100
Output:
right-skewed
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