Design and implement a data structure for a compressed string iterator. The given compressed string will be in the form of each letter followed by a positive integer representing the number of this letter existing in the original uncompressed string.
Implement the StringIterator class:
next()
hasNext() Returns true if there is any letter needs to be uncompressed in the original string, otherwise returns false.
/** * Your StringIterator object will be instantiated and called as such: * StringIterator* obj = new StringIterator(compressedString); * char param_1 = obj->next(); * bool param_2 = obj->hasNext(); */