Given two strings S and T, return if they are equal when both are typed into empty text editors. # means a backspace character.
Note:
1 <= S.length <= 200
1 <= T.length <= 200
S and T only contain lowercase letters and '#' characters.
給兩個字串S和T,回傳他們是否相同。#符號代表一個倒退字元(Backspace鍵)。
注意:
S和T長度都介於1到200
S和T只會包含小寫字母和'#'符號。
O(N)
和空間複雜度O(1)
。
S
和T
處理。#
。#
還沒使用,以免在連續的#
發生錯誤。LeetCode
C++