Algorithm · Waymo · Easy
You receive a string compressed with run-length encoding, for example B1A2E3C1, where each character is followed by the number of times it repeats. Write find(encoded, p), which reports the character located at position p (counting from zero) of the expanded sequence. A repeat count can span more than one digit. Your implementation must not expand the entire input into its decoded form. For instance, with B1A2E3C1 the expanded sequence is BAAEEEC, so asking for positions 0,…