408. Backspace String Compare
EasyStackTwo Pointers
In each string, # is a backspace. Print YES if both strings produce the same text, else NO.
Input format
Line 1: s Line 2: t
Output format
YES or NO
Example 1
Input
ab#c ad#c
Output
YES
Example 2
Input
ab## c#d#
Output
YES
Constraints
1 ≤ |s|, |t| ≤ 10⁵
Read input from standard input and print the answer to standard output. Your code is judged against 5 test cases, most of them hidden.
Loading the MyLoginn IDE…