Backspace String Compare, is a LeetCode problem. In this post we will see how we can solve this challenge in C++

Problem Description

Given two strings S and T, return if they are equal when both are typed into empty text editors. # means a backspace character.

Example 1:

Input: S = "ab#c", T = "ad#c" Output: true Explanation: Both S and T become "ac".

Example 2:

Input: S = "ab##", T = "c#d#" Output: true Explanation: Both S and T become "".

Example 3:

....

You can find the full details of the problem Backspace String Compare at LeetCode

Solution: Please check the main.cpp snippet for the solution.

This solution originally posted at: Github by @kamyu104