Round 1
Questions:
Question
Given two strings s
and t
, return true
if they are equal when both are typed into empty text editors. #
means a backspace character.
Example:
- Input:
s = "ab#c"
,t = "ad#c"
→ Output:true
- Input:
s = "ab##"
,t = "c#d#"
→ Output:true
- Input:
s = "a#c"
,t = "b"
→ Output:false
Candidate's Approach
The candidate used a two-pointer approach to traverse both strings from the end to the start, simulating the backspace operations. They maintained skip counters for each string to handle the #
characters and compared valid characters as they moved through the strings.
Interviewer's Feedback
No feedback provided.