Question: Backspace Comparison You are to compare two strings as if they were typed into a text editor, and see if they are equal. The strings

Backspace Comparison

You are to compare two strings as if they were typed into a text editor, and see if they are equal. The strings will only include uppercase letters, lowercase letters, and the char %. The char % represents backspace in this fictitious text editor. Whenever you encounter a % in the string, delete the previous non-% character if one exists. There are a few ways to solve this, but please use a stack based method. Print Strings are equal if your function returns true, and Strings are not equal if the function returns false. Do not use the following libraries: algorithm, cmath Examples Input of "App%%le" and "Ap%p%le" will return true because after performing the backspace operation the strings will be Ale and Ale Input of "r%u%n%n%ing%" and "run%%%ning%%" will return false because after performing the backspace operation the strings will be in and ni Input Two strings consisting over uppercase letters, lowercase letters, and the char % Output Print Strings are equal if your function returns true, and Strings are not equal if the function returns false.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!