Company: Amex_23july
Difficulty: medium
OCR Output Equivalence Problem Description You are given two passages of text that have been scanned and passed through OCR software. (OCR stands for Optical Character Recognition, which is the conversion of printed text into machine-readable strings.) Unfortunately, the scans were of poor quality and some letters were not recognized by the OCR software. Write a program to check (based on the output from the OCR software) whether the two text sources might in fact be the same. We assume that each text passage consists only of English letters. The OCR output from each scan is given as a string in which unrecognized letters are marked as follows. Firstly, let us mark each unrecognized letter by "?". For example, if the OCR software didn't recognize the second and third letters of the text "AppLe", it would result in OCR output of "A??Le". Then, for brevity, every group of K consecutive "?" characters is replaced by the decimal representation of integer K (without leading zeros). Thus, th