1047. Remove All Adjacent Duplicates In String
模拟栈
Input: s = "abbaca"
Output: "ca"
Explanation:
For example, in "abbaca" we could remove "bb" since the letters are adjacent and equal, and this is the only possible move. The result of this move is that the string is "aaca", of which only "aa" is possible, so the final string is "ca".Input: s = "azxxzy"
Output: "ay"栈的应用
Last updated