Another XKCD inspired competition. This one is based on Keyboard Mash.
Given a input string, identify the anomalous characters, assuming that the majority have been typed on a single row of the standard US QWERTY keyboard. Input strings can contain shifted key strokes, but they will not contain carriage returns (Enter), CTRL/ALT affected characters, spaces, tabs and backspaces (because that would be silly). The number pad will not be considered as part of the keyboard for this challenge.
The challenge is to output the characters that aren't on the same keyboard row as the majority of individual characters in the single string. The output should contain each anomalous character only once and no other characters.
In the case of a equal count of anomalous characters across two or more rows, the tie break is determined in this order:
- Shortest unique list
- Top most row
Input
A string through either STDIN, ARGV or a function parameter
Output
A string to STDOUT or a function return. It should have each anomalous character only once, but does not need to be ordered.
Examples
Input: FJAFJKLDSKF7KFDJ
Output: 7Input: ASDF11111
Output: ASDFInput: lkjrhsDdftkjhrksRjd
Output: rtRInput: }*3%&2098@$2k234#@$M
Output: }Topmost row list returned
Input: ASD!@#Vcx
Output: !@#Shortest unique list returned
Input: ASdf1233qwER
Output: 123Topmost shortest list returned
Input: 12334QWTTSDFDSXVVBBX
Output: QWT
This is code golf, so shortest entry wins.