Backspace String Compare
Solve this the way you would in the interview: out loud, on a timer, with an AI interviewer asking follow-ups while you code. You get a scored report at the end.
Practice this as a mock interviewFree to start, no account neededProblem
Two strings s and t were typed into separate text editors. Lowercase letters are typed normally, while the '#' character acts as a backspace that deletes the character immediately before the cursor. A backspace on an empty editor does nothing.
Return true if both editors end up showing the same text, and false otherwise.
Can you solve it in O(n + m) time and O(1) extra space?
Examples
Constraints
- 1 <= s.length, t.length <= 200
- s and t contain only lowercase letters and the character #
What the interviewer grades
A correct solution is one of five scores. The report also grades problem understanding (did you clarify inputs and edge cases before coding), problem solving, communication while you work, code quality, and testing. See a sample report, or read up on the pattern in the lessons.