C++ backtracking
This is just simmilar to permutation (find all combinations) problems with a constraint about the number of characters and the order of character.\n\nclass Comb
This is just simmilar to permutation (find all combinations) problems with a constraint about the number of characters and the order of character.\n```\nclass CombinationIterator {\n    vector<string> comb; \n    int cur = 0 ; \npublic:\n    CombinationIterator(string characters, int combinationLength) {\n        \n        permute(characters, "", 0 , combinationLength); \n        \n    }\n    \n    void permute(string characters, string s, int start,  int length){\n        \n        if(s.size() == length){\n            //cout << s << endl; \n            comb.push_back(s); \n            \n        } else{\n            for(int i = start ; i < characters.size(); i++ ){\n                s += characters[i];\n                permute(characters, s, i+1, length);\n                s.pop_back();\n            }\n        \n        }\n        \n    }\n    \n    string next() {\n        return comb[cur++]; \n    }\n    \n    bool hasNext() {\n        return cur == comb.size()? false: true; \n    }\n};\n```
[]