Although the honor system has always worked quite well, the club wants to run some tests to see how many people really follow the rules. You are to write a program that takes the entrance log files from three different clubs (all logging the same day) and return a sorted list of the people who are not honest and went to more than one health club location in the same day.
The log files are represented as String[]'s
where each element is the
member name of a customer who entered that day. For example, if a
customer showed up three times to one of the club locations that
day, the member's name would appear three times in the corresponding
String[].
String[]
should be sorted in
lexicographic order (the order they would appear in a dictionary).
club1, club2, and club3 each have between 1 and 50 elements,
inclusive.
club1, club2, and club3 contains between 1 and 50 characters, inclusive.
club1, club2, and club3 consists only of uppercase letters ('A'-'Z').
{"JOHN","JOHN","FRED","PEG"}
{"PEG","GEORGE"}
{"GEORGE","DAVID"}
Returns: { "GEORGE", "PEG" }
"PEG" went to club1 and club2, and "GEORGE" went to club2 and club3.
{"DOUG","DOUG","DOUG","DOUG","DOUG"}
{"BOBBY","BOBBY"}
{"JAMES"}
Returns: { }
Here, no one went to more than one club location.
{"BOBBY"}
{"BOB","BOBBY"}
{"BOB"}
Returns: { "BOB", "BOBBY" }
Note that "BOB" is sorted before "BOBBY"
{"BOBBY","HUGH","LIZ","GEORGE"}
{"ELIZABETH","WILL"}
{"BOB","BOBBY","BOBBY","PAM","LIZ","BOBBY","BOBBY","WILL"}
Returns: { "BOBBY", "LIZ", "WILL" }
{"JAMES","HUGH","HUGH","GEORGE","ELIZABETH","ELIZABETH","HUGH",
"DAVID","ROBERT","DAVID","BOB","BOBBY","PAM","JAMES","JAMES"}
{"BOBBY","ROBERT","GEORGE","JAMES","PEG","JAMES","DAVID","JOHN","LIZ",
"SANDRA","GEORGE","JOHN","GEORGE","ELIZABETH","LIZ","JAMES"}
{"ROBERT","ROBERT","ROBERT","SANDRA","PAM","BOB","LIZ","GEORGE"}
Returns: { "BOB","BOBBY","DAVID","ELIZABETH","GEORGE","JAMES","LIZ","PAM","ROBERT", "SANDRA" }
{"LIZ","WILL","JAMES"}
{"JOHN","ROBERT","GEORGE","LIZ","PEG","HUGH","BOB","BOBBY","ROBERT","ELIZABETH","DAVID"}
{"PAM","DAVID","SANDRA","GEORGE","JOHN","ROBERT","SANDRA","GEORGE"}
Returns: { "DAVID", "GEORGE", "JOHN", "LIZ", "ROBERT" }
{"PEG","ROBERT","PAM","JOHN","DAVID","JOHN","ROBERT",
"GEORGE","HUGH","WILL","JAMES","JAMES","BOBBY","BOBBY","SANDRA"}
{"SANDRA","BOB","PAM","JAMES","WILL","DAVID","BOBBY","GEORGE",
"WILL","LIZ","BOBBY","ROBERT","WILL","BOB","BOBBY","ELIZABETH","HUGH"}
{"WILL","PEG","ELIZABETH","DAVID","HUGH","BOBBY","JOHN","SANDRA","ELIZABETH",
"ELIZABETH","SANDRA","GEORGE","PAM","ELIZABETH","BOBBY","DAVID","PAM"}
Returns:
{ "BOBBY",
"DAVID",
"ELIZABETH",
"GEORGE",
"HUGH",
"JAMES",
"JOHN",
"PAM",
"PEG",
"ROBERT",
"SANDRA",
"WILL" }
{"AHHOZY","AHHAPLL","ASNV"}
{"AHDLTOE","AHUKPJ","AHDENCTPP","AHDENCJ","AHDLNZC","AHDLTOGG","AHHAPMBG",
"ALE","AHBHA","AHUKP","AHDQMILLP","AHDENEDY","AHDENEE","AHHOHVCX","AHISK",
"AHW","AQDB","AHUP","AQDBNPU","AGWZUV","AHHOSUW","AHXS","AHDENCP","AHDQM",
"AHDLTURV","AHBHVV","AHDQMILL","AHDQMD","AHH","AHDLTU","AHISFNO","AHURF",
"AH","AHHAPNQ","AQPL","AHDXL","AHDLTUGX","AHDLT","AHUKRC","AHDLTUGX",
"AQDTXYX","AGWZS"}
{"AHHAPMFF","AHURA","AHHOZ","AHISKH","AHUPR","AHHAPM","AHUKRHIN","AHHAP",
"AHDLTMO","AHDLTUJ","AHDQY","AHUK","AHDENEDY","AHWK","AHHOZGJJ","AHXS",
"AHDLTUREL","AHHOZQNL","AHHOSUWOS"}
Returns: { "AHDENEDY", "AHXS" }