[Java] No pre-calculation needed for iterator questions
Process the string (str) lexicographically and only store the next result in a stack of characters. Dynamically generate the next combination every-time next() 
Process the string (str) lexicographically and only store the next result in a stack of characters. Dynamically generate the next combination every-time `next()` is called.\n```\nclass CombinationIterator {\n    \n    Stack<Character> st; // stack to store the characters leading to the creation of a single combination\n\tMap<Character, Integer> ch2Idx; // map to store character to index\n    String result, str; // str - same as characters. result -- the result string representing a combination\n    int combLength; // same as combinationLength\n \n    public CombinationIterator(String characters, int combinationLength) {\n        combLength = combinationLength;\n        ch2Idx = new HashMap();\n        str = characters;\n        st = new Stack();\n        result = "";\n\t\t// create the first combination\n        for (Character ch : characters.toCharArray()) {\n            st.push(ch);\n            result = result + ch;\n            if (st.size()==combinationLength) break;\n        }\n        int idx = 0;\n\t\t// set up the mapping between character --> index\n        for (Character ch : characters.toCharArray()) {\n            ch2Idx.put(ch, idx++);\n        }\n    }\n    \n    public String next() {\n        String currResult = result;\n        // process the next result\n      \n        int idx = str.length()-1;\n\t\t// keep on removing the last character from the stack/result till the position where idx can be moved ahead\n        while (!st.isEmpty() && ch2Idx.get(st.peek())==idx) {\n            st.pop();\n            idx--;\n            result = result.substring(0, result.length()-1);  \n        }\n        if (st.isEmpty()) return currResult; // there is no next result to pre-process\n        \n        idx = ch2Idx.get(st.pop()); // we need to add elements after this idx\n        result = result.substring(0, result.length()-1);\n        \n        while (st.size()!=combLength) {\n            Character temp = str.charAt(++idx);\n            result+=temp;\n            st.push(temp);\n        }\n        \n        return currResult;\n    }\n    \n    public boolean hasNext() {\n        return !st.isEmpty();\n    }\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 * boolean param_2 = obj.hasNext();\n */\n ```
[]