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 tvector<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 tvector<string>.
const tvector<string>&, const tvector<string>&,
const tvector<string>&
tvector<string>
tvector<string> whosDishonest(const tvector<string>& club1, const tvector<string>& club2, const tvector<string>& club3)
(be sure your method is public)
tvector<string> should be sorted in
lexicographic order (the order they would appear in a dictionary).
club1 = {"JOHN","JOHN","FRED","PEG"}
club2 = {"PEG","GEORGE"}
club3 = {"GEORGE","DAVID"}
Returns: { "GEORGE", "PEG" }
"PEG" went to club1 and club2, and "GEORGE" went to club2 and club3.
club1 = {"DOUG","DOUG","DOUG","DOUG","DOUG"}
club2 = {"BOBBY","BOBBY"}
club3 = {"JAMES"}
Returns: { }
Here, no one went to more than one club location.
club1 = {"BOBBY"}
club2 = {"BOB","BOBBY"}
club3 = {"BOB"}
Returns: { "BOB", "BOBBY" }
Note that "BOB" is sorted before "BOBBY"
club1 = {"BOBBY","HUGH","LIZ","GEORGE"}
club2 = {"ELIZABETH","WILL"}
club3 = {"BOB","BOBBY","BOBBY","PAM","LIZ","BOBBY","BOBBY","WILL"}
Returns: { "BOBBY", "LIZ", "WILL" }
club1 = {"JAMES","HUGH","HUGH","GEORGE","ELIZABETH","ELIZABETH","HUGH",
"DAVID","ROBERT","DAVID","BOB","BOBBY","PAM","JAMES","JAMES"}
club2 = {"BOBBY","ROBERT","GEORGE","JAMES","PEG","JAMES","DAVID","JOHN","LIZ",
"SANDRA","GEORGE","JOHN","GEORGE","ELIZABETH","LIZ","JAMES"}
club3 = {"ROBERT","ROBERT","ROBERT","SANDRA","PAM","BOB","LIZ","GEORGE"}
Returns:
{ "BOB",
"BOBBY",
"DAVID",
"ELIZABETH",
"GEORGE",
"JAMES",
"LIZ",
"PAM",
"ROBERT",
"SANDRA" }
club1 = {"LIZ","WILL","JAMES"}
club2 = {"JOHN","ROBERT","GEORGE","LIZ","PEG","HUGH","BOB","BOBBY","ROBERT","ELIZABETH","DAVID"}
club3 = {"PAM","DAVID","SANDRA","GEORGE","JOHN","ROBERT","SANDRA","GEORGE"}
Returns: { "DAVID", "GEORGE", "JOHN", "LIZ", "ROBERT" }
club1 = {"PEG","ROBERT","PAM","JOHN","DAVID","JOHN","ROBERT",
"GEORGE","HUGH","WILL","JAMES","JAMES","BOBBY","BOBBY","SANDRA"}
club2 = {"SANDRA","BOB","PAM","JAMES","WILL","DAVID","BOBBY","GEORGE",
"WILL","LIZ","BOBBY","ROBERT","WILL","BOB","BOBBY","ELIZABETH","HUGH"}
club3 = {"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" }
club1 = {"AHHOZY","AHHAPLL","ASNV"}
club2 = {"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"}
club3 = {"AHHAPMFF","AHURA","AHHOZ","AHISKH","AHUPR","AHHAPM","AHUKRHIN","AHHAP",
"AHDLTMO","AHDLTUJ","AHDQY","AHUK","AHDENEDY","AHWK","AHHOZGJJ","AHXS",
"AHDLTUREL","AHHOZQNL","AHHOSUWOS"}
Returns: { "AHDENEDY", "AHXS" }