We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
维护两个栈,最后进行对比
var backspaceCompare = function(S, T) { let s = [], t = []; let len = S.length > T.length ? S.length : T.length; for (let i = 0; i < len; i++) { if (S[i] === '#') { s.pop(); } else if (S[i]) { s.push(S[i]); } if (T[i] === '#') { t.pop(); } else if (T[i]) { t.push(T[i]); } } return t.join() === s.join(); };
The text was updated successfully, but these errors were encountered:
No branches or pull requests
844. 比较含退格的字符串
解题思路
维护两个栈,最后进行对比
复杂度分析
The text was updated successfully, but these errors were encountered: