rouge"><span class="n">Stack</span></code> an ideal choice if you only add/remove at top or <code class="language-c++ highlighter-rouge"><span class="n">Queue</span></code> perfect if you remove from head and add at tail. There is a small win for choosing <code class="language-c++ highlighter-rouge"><span class="n">HashSet</span></code>/<code class="language-c++ highlighter-rouge"><span class="n">HashMap</span></code> over <code class="language-c++ highlighter-rouge"><span class="n">Set</span></code>/<code 