Check If Word Is Valid After Substitutions
Push letters onto a stack and delete every abc that forms on top; the word is valid when the stack empties.
Push letters onto a stack and delete every abc that forms on top; the word is valid when the stack empties.