题目链接
英文链接:https://leetcode.com/problems/backspace-string-compare/
中文链接:https://leetcode-cn.com/problems/backspace-string-compare/
题目详述
给定 S
和 T
两个字符串,当它们分别被输入到空白的文本编辑器后,判断二者是否相等,并返回结果。 #
代表退格字符。
示例 1:
1 | 输入:S = "ab#c", T = "ad#c" |
示例 2:
1 | 输入:S = "ab##", T = "c#d#" |
示例 3:
1 | 输入:S = "a##c", T = "#a#c" |
示例 4:
1 | 输入:S = "a#c", T = "b" |
提示:
1 <= S.length <= 200
1 <= T.length <= 200
S
和T
只含有小写字母以及字符'#'
。