• + 3 comments

    If I'm reading it correctly, it's basically saying:

    If deque does not contain the element that we just removed (which implies that it's not there at all any more), we remove it from the set. The alternative, if deque still contained an element after we removed it, that would mean that there were at least two of those element in the sub-array, and so we have at least one left over. Therefore, it should still be considered part of the 'set'.