An agent editing a reply in the Intercom Inbox may use # to represent a backspace in a draft. Given two draft strings, determine whether they produce the same final text after processing every backspace.
A backspace removes the closest preceding character that has not already been removed. If no such character exists, the backspace has no effect. Comparison is case-sensitive, and the result must be returned as a boolean.
Implement compare_drafts(first, second).
first and second, containing lowercase English letters and # characters.True if both drafts resolve to the same final string, otherwise False.#def compare_drafts(first, second):