Algorithm · Waymo · Medium
Requirements Store the sequence as consecutive runs. For instance, {D, D, F, F, F, H} becomes D2F3H1. Part 1: char Find(int p) must report the character at decoded position p, using zero-based positions, while avoiding construction of the full expanded sequence. Part 2: the decoded characters are guaranteed to be in sorted order. Write char FindByValue(char target, int left, int right) to return the greatest character in decoded interval [left, right] that is strictly larger…
Checking your access…