Search⌘ K
AI Features

Backspace String Compare

Backspace String Compare gives two strings typed into an empty editor, where '#' deletes the previous character. Return whether both strings produce the same final text.

Statement

Given two strings s and t, return true if they produce the same result when typed into an empty text editor, where '#' represents a backspace character. Applying a backspace on an empty editor leaves it unchanged.

Note: Can you solve it in O(n)O(n) ...