subject

A health club chain allows its members to visit any of its many health club locations an unlimited number of times per day. The only constraining rule is, a customer can only visit one health club location per day, even though he or she may return to that location an unlimited number of times for the rest of that day. 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 vector'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 vector.
Notes
club1, club2, and club3 may contain a different number of elements.
The same member name can appear multiple times in a single log file.
The elements of the returned vector should be distinct and sorted in lexicographic order (the order they would appear in a dictionary).
Assume that two people with the same name are in fact the same person.
Constraints
club1, club2, and club3 each have between 1 and 50 elements, inclusive.
Each element of club1, club2, and club3 contains between 1 and 50 characters, inclusive.
Each element of club1, club2, and club3 consists only of uppercase letters ('A'-'Z').
Examples
{"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","EL IZABETH","ELIZABETH","HUGH",
"DAVID","ROBERT","DAVID","BOB","BOB BY","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","PE G","HUGH","BOB","BOBBY","ROBERT","E LIZABETH","DAVID"}
{"PAM","DAVID","SANDRA","GEORGE","J OHN","ROBERT","SANDRA","GEORGE"}
Returns: { "DAVID", "GEORGE", "JOHN", "LIZ", "ROBERT" }
{"PEG","ROBERT","PAM","JOHN","DAVID ","JOHN","ROBERT",
"GEORGE","HUGH","WILL","JAMES","JAM ES","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","ELIZ ABETH",
"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","AH DENCJ","AHDLNZC","AHDLTOGG","AHHAPM BG",
"ALE","AHBHA","AHUKP","AHDQMILLP"," AHDENEDY","AHDENEE","AHHOHVCX","AHI SK",
"AHW","AQDB","AHUP","AQDBNPU","AGWZ UV","AHHOSUW","AHXS","AHDENCP","AHD QM",
"AHDLTURV","AHBHVV","AHDQMILL","AHD QMD","AHH","AHDLTU","AHISFNO","AHUR F",
"AH","AHHAPNQ","AQPL","AHDXL","AHDL TUGX","AHDLT","AHUKRC","AHDLTUGX",< br /> "AQDTXYX","AGWZS"}
{"AHHAPMFF","AHURA","AHHOZ","AHISKH ","AHUPR","AHHAPM","AHUKRHIN","AHHA P",
"AHDLTMO","AHDLTUJ","AHDQY","AHUK", "AHDENEDY","AHWK","AHHOZGJJ","AHXS" ,
"AHDLTUREL","AHHOZQNL","AHHOSUWOS"}
Returns: { "AHDENEDY", "AHXS" }
Given Function
#include
#include
vector whos_dishonest(vector &club1,
vector &club2,
vector &club3) {
cout << "[LIZ]" << endl;
// you write code here
}
Complete the Given Function to solve the problem statement. Please follow the given notes and constraints. Please code this problem in C++.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 20:20
Sometimes writers elaborate on the truth when recalling past events so they can enhance their narrative essay with more interesting descriptions. do you feel that published writers should or should not embellish real life events just to make their stories more interesting?
Answers: 2
question
Computers and Technology, 22.06.2019 19:20
Consider the following code snippet: #ifndef cashregister_h#define cashregister_hconst double max_balance = 6000000.0; class cashregister{public: cashregister(); cashregister(double new_balance); void set_balance(double new_balance); double get_balance() const; private: double balance[12]; }; double get_monthly_balance(cashregister bk, int month); #endifwhich of the following is correct? a)the header file is correct as given.b)the definition of max_balance should be removed since header files should not contain constants.c)the definition of cashregister should be removed since header files should not contain class definitions.d)the body of the get_monthly_balance function should be added to the header file.
Answers: 1
question
Computers and Technology, 23.06.2019 02:30
Three out of five seniors remain undecided about a college major at the end of their senior year.
Answers: 3
question
Computers and Technology, 23.06.2019 04:31
Acloud service provider uses the internet to deliver a computing environment for developing, running, and managing software applications. which cloud service model does the provider offer? a. iaas b. caas c. maas d. paas e. saas
Answers: 1
You know the right answer?
A health club chain allows its members to visit any of its many health club locations an unlimited n...
Questions
Questions on the website: 13722361