Question: Assume your keyboard does not have a backspace key; thus, if you make a data entry error, you must use the # character to correct
-
Assume your keyboard does not have a backspace key; thus, if you make a data entry error, you must use the # character to correct your mistake as follows: Each # erases the previous character entered, but consecutive # characters do not cancel out; instead they are applied in sequence and so erase several characters. For instance, if the input line is:
A
1. Assume your keyboard does not have a backspace key; thus, if you make a data entry error, you must use the # character to correct your mistake as follows: Each # erases the previous character entered, but consecutive # characters do not cancel out; instead they are applied in sequence and so erase several characters. For instance if the input line is: abc defgh #2klmn opqr##wxyz the corrected output would be: abc defg2klmn opwxyz Write a function to perform this correction using stack
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
