#17 Backspace String Comparison

Companies:
T-Bank
Themes:
AlgorithmsStringsPractice

Two strings consisting of lowercase Latin letters and the deletion symbol '#' (backspace) are given. Check whether the strings are equal after applying backspaces.

// "ab#c" == "ad#c" -> true ("ac" == "ac")
// "ab##" == "c#d#" -> true ("" == "")
// "a#c" == "b" -> false ("c" != "b")
boolean backspaceCompare(String s, String t) {
    ...
}

Question review

Mentor
Answer as you would in a real interview. I’ll ask follow-up questions, then compare your answer with the reference answer and show your accuracy as a %.
Sign in to start the dialogue The mentor keeps the context of the current question and your previous messages.
Sign in