Why 'stack' is the tag for this question?


  • 0
    Z

    Just curious why 'stack' marked as the tag of this question? Seems in C++ vector could solve it smoothly, Could anyone share a stack approach/ Implementation?

    Thank you


  • 0
    Y

    Stack is listed because you will need a stack-like operation to keep the previous string for "..". For vector, you will be using things like pop_back(), that's your stack operation. So what you are describing is "stack" tag.


  • 0
    Z

    Thanks for the comment, that answers my question. Seems like we could implement a stack with vector, so just curious in what scenarios we should choose stack other than vector?


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.