Code:
strSet.insert(variable[string(it,i)]++);
That should simply be strSet[string(it,i)]++;
Code:
i <= data.length() && i <= distance(it,data.end())
Looking back, you can get rid of the "i <= data.length() &&" part of that... it is not necessary.
Code:
for(strSet.begin(),strSet.end(),ostream_iterator<string>(cout,"\n"));
This is not how a for loop is done. Also, I ran a test using my program and your long test string, I knew the output wasn't going to mean much if sent to cout so I opened an output file and wrote the contents of the map to that. That was a good decision since the file turned out to be 56KB in size. My output code was this:
Code:
ofstream output("output.txt");
for( map<string,int>::iterator it2 = strSet.begin(); it2 != strSet.end(); ++it2 )
output << it2->second << " - " << it2->first << endl;
You will need to #include <fstream> to work with files. That will create an output file called output.txt that looks something like (taking some output from my file that was created):
Code:
26 - A
7 - AA
6 - AAA
5 - AAAA
4 - AAAAA
3 - AAAAAA
2 - AAAAAAA
1 - AAAAAAAA
1 - AAAAAAAAC
...
This is really just for debugging purposes. Your goal now will be to most likely replace the output loop with one that goes throught the map and simply finds the "biggest number of repeats" as you put it according to whatever your rules are for determining that.