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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started