Alex
BAN USERstring repeats(string s)
{
for(int i=0; i<s.length(); i++)
{
string::iterator first = s.begin()+i;
for(int j = i+1; j < s.length(); j++)
{
string::iterator second = s.begin()+j;
string::iterator search1 = first+1;
string::iterator search2 = second+1;
while(search1 != s.end() && search2 !=s.end())
{
while(search1 != s.end() && *search1 != *first)
{
search1++;
}
if(search1 != s.end())
{
if(*search1 == *first)
{
search2 = search1+1;
while(search2 != s.end() && *search2 != *second)
{
search2++;
}
if(search2 != s.end())
{
if(*search1 = *first && *search2 == *second)
{
return "YES";
}
}
}
}
}
}
}
return "NO";
}
Actually I think you can check 2. If it contains Y on the back then 1 MUST contain X.
I think the minimum to prove is 1 because if you check 2 first and you get X then you got lucky and proved X has an even number. Likewise if you had checked X first and it had 2 on the back.
void create_list(Node *rootNode)
{
q.push_back(rootNode->left);
q.push_back(rootNode->right);
rootNode->left = NULL;
rootNode->right = NULL;
while(q.size() > 0)
{
q = process_q(q);
}
}
deque<Node*> process_q(deque<Node*> q)
{
deque<Nodes*> qNextLevel;
Node *currentNode = q.front();
q.pop_front();
qNextLevel.push_back(currentNode->left);
qNextLevel.push_back(currentNode->right);
while(q.size() > 0)
{
Node *nextNode = q.front();
qNextLevel.push_back(nextNode->left);
qNextLevel.push_back(nextNode->right);
currentNode->left = NULL;
currentNode->right = nextNode;
currentNode = nextNode;
q.pop_front();
}
currentNode->right = NULL;
return qNextLevel;
}
RepDimaOxygen15, Computer Scientist at Headrun Technologies Pvt Ltd
Hi! all my sweets friends My name is Dimo Oxygen! Now I study in Victoria University of Wellington New Zealand ...
Repaileenpankney, photographer at Precious Moments
Confident and dedicated photographer with experience in both professional and freelance photography. I like to explore Black Magic Spell To ...
Repsherykasper, Accountant at A9
Bonjour, je travaille dans une entreprise en tant que caissier. J'habite à Maysville mais je suis en fait d ...
Repmarktrejjo, Data Engineer at Accolite software
I’m Mark.I believe life is too short to be serious all the time, so if you cannot laugh ...
Repriverajenny935, i love my shop piano at xyz
Hello Everyone,My Name is Jenny Rivera .I have been a piano instructor for more than 25 years! I earned ...
Repjuanktait, Blockchain Developer at ADP
I am Juan from Seattle, WA. I am working as a LAN administrator. I love music, reading historical books, and ...
RepOur mission is to provide informative and Self Improvement advice to help people live their lives better set definite goals ...
RepLooking for the best child development center in Charlotte? Pal A Roos provide summer camp for children Charlotte. Our experienced ...
RepVirginialdelmonte, Animator at lostlovebackvashikaran
Have you lost your husband love? And you want to control your husband mind with vashikaran mantra. Guru ji is ...
Repsunita212jain, Android test engineer at Computer Associates
My name is Sunita jain. I am in Chandigarh (India). I am a computer hardware retailer and wholesaler. I also ...
I believe this should work.
- Alex February 28, 2015