Logo
IconChallenge
Icon
IconProblem
IconSolutions
IconSubmissions

Backspace String Compare

XPChallenge Points: 10
levelLevel: Easy

You are given two strings s and t.
You need to return True if both strings are the same after simulating typing with backspaces (#).
' #' means deleting one previous character if it exists.

Example 1:

Input: s = "ab#c" t = "ad#c"

Output: True

Example 2:

Input: s = "ab##" t = "c#d#"

Output: True

to Continue
like
dislike

Accepted:

Submission:

IconReport an issue
Icon
IconCode
IconYou need toto run or submitYou need toto run or submit
IconTest Case
IconTest Result