C++
\nclass CombinationIterator {\npublic:\n    int ind = 0 ;\n    vector<string> all_ ; \n    CombinationIterator(string characters, int combinationLength) {\n    
```\nclass CombinationIterator {\npublic:\n    int ind = 0 ;\n    vector<string> all_ ; \n    CombinationIterator(string characters, int combinationLength) {\n        int sz = characters.size() ;\n        int to_ = ( 1 << sz ) - 1 ;\n        for( int i = 1 ; i <= to_ ; i ++ )\n        {\n            string temp = "" ;\n            for( int bit = 0 ; bit < sz ; bit ++ )\n            {\n                if(  ( 1 << bit ) & i )   temp += characters[bit] ;\n            }\n            if( temp.size() == combinationLength )\n            { \n                all_.push_back(temp);\n            }\n        }\n        sort(all_.begin() , all_.end());\n    }\n    \n    string next() {\n        return all_[ind++] ;\n    }\n    \n    bool hasNext() {\n        return ind < all_.size() ;\n    }\n};\n\n/**\n * Your CombinationIterator object will be instantiated and called as such:\n * CombinationIterator* obj = new CombinationIterator(characters, combinationLength);\n * string param_1 = obj->next();\n * bool param_2 = obj->hasNext();\n */\n ```
[]