vkbajoria
BAN USER
Repjoyjerraj, Android test engineer at ASAPInfosystemsPvtLtd
I am a sales manager .I'm responsible for leading and coaching a team of salespeople. A sales manager's ...
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 ...
Repryanahurd, Korean Air Change Flight at 247quickbookshelp
Je suis Ryana avec 2 ans d'expérience dans la gestion d'un flux de travail à haut volume en ...
Repgarlandkrebs, Animator at ADP
Highly focused and seasoned magazine editor with vast experience in all stages of weekly and monthly magazine production. My aim ...
Repannawellson007, Area Sales Manager at 8x8
Hey my name is anna And i am working as a content writer in Search engine optimization company.My component ...
RepI graduated from College with a master’s degree in arthrogryposis. After graduation I am working as a manager in ...
Repronalddavis284, Accountant at ADP
As you may be able to infer from my professional background, I have a strong interest in mathematics and the ...
Repivaharvie, Production Engineer at BMO Harris Bank
Je suis Iva, professeur de musique et compositeur avec plus de 6 ans d'expérience avec une connaissance approfondie de ...
RepSaraLopez, abc at ADP
Experienced in all aspects of business formation, operation, finance, and management. Visionary product developer with deep education in research and ...
Repamayahoyle, Associate at ABC TECH SUPPORT
Working as a Set Designer with 2+ years of experience in Audio Aid for vehicles and props including turns using ...
Repkarmacknha, Accountant at Groupon
I am a forensic nurse . who has received specific education and training. I provide specialized care for patients who are ...
Repjacksabjohne, Accountant at ABC TECH SUPPORT
Michael is a Biological Technician with 4 years of experience monitoring, characterizing, and quantifying riverine processes and habitat in the ...
RepI am Rasha , C/C++ certified Computer Programmer with expert-level competency in JavaScript, HTML and JSP and more than 6 ...
Reprafaeltanner210, Associate at 247quickbookshelp
I am Labor relations directors, oversee employment policies in union and nonunion settings. I draw up, negotiate, and administer labor ...
Repprishamondel, Quality Assurance Engineer at Bloomberg LP
I am Prisha, a versatile self-starter and a quick learner looking for a position within your company, Netaid. My hobbies ...
Repnorahuerta1111, Accountant at ABC TECH SUPPORT
Hey, I'm Nora Huerta, and I'm working as a journalist. And nowadays I am doing part time jobs ...
Repkiaspenill, HTML Experienced at Computer Associates
I am Kia, a skilled cook with 2+ years of experience. Extensive knowledge of the food industry and its relation ...
RepRobin has more than 26 years of experience working for state, city, university, and public entities as a fisheries ecologist ...
RepTimothyAYocum1, Android Engineer at ABC TECH SUPPORT
I am a medical or osteopathic doctor who specializes in eye and vision care. My work Ophthalmologists differ from optometrists ...
I have two solutions. One with permutation and one without permutation using bitset.
- vkbajoria June 04, 2014#include "stdafx.h"
#include <iostream>
#include <string>
#include <set>
#include <bitset>
using namespace std;
set<string> perm;
void replace(string str, string strWith) {
int index = 0;
for(int i=0; i< str.length(); ++i) {
if(str[i] == '?') str[i] = strWith[index++];
}
cout << str << endl;
}
void parmutation(string str, string endStr) {
if(str.length() == 0) perm.insert(endStr);
for(size_t i = 0; i < str.length(); ++i) {
string StrIn = str;
string StrEnd = endStr;
StrIn.erase(i,1);
StrEnd += str.at(i);
parmutation(StrIn,StrEnd);
}
}
void replaceString(string str) {
perm.insert("0000");
parmutation("0001","");
parmutation("0011","");
parmutation("0111","");
perm.insert("1111");
for(auto it= perm.begin(); it != perm.end(); ++it) {
replace(str,*it);
}
}
void replaceWithPermutation(string str) {
for(int i=0; i< 16; ++i) {
bitset<4> bt(i);
replace(str,bt.to_string<char,string::traits_type,string::allocator_type>());
}
}
int main()
{
replaceString("a?b?c?d?");
cout << endl;
replaceWithPermutation("a?b?c?d?");
while(1) {}
return 0;
}