Problem Statement | |||||||||||||
After selling goods all day, a salesman would like to determine the most desirable item in his inventory. You are given a String[] items, each element of which represents a single item that was sold during the day. Return the item that was sold the most number of times. In case of a tie, return the item that comes first alphabetically. | |||||||||||||
Definition | |||||||||||||
| |||||||||||||
Constraints | |||||||||||||
- | items will contain between 1 and 50 elements, inclusive. | ||||||||||||
- | Each element of items will contain between 1 and 50 characters, inclusive. | ||||||||||||
- | Each element of items will contain only lowercase letters ('a'-'z'). | ||||||||||||
Examples | |||||||||||||
0) | |||||||||||||
| |||||||||||||
1) | |||||||||||||
| |||||||||||||
2) | |||||||||||||
| |||||||||||||
3) | |||||||||||||
|