Character at an index of a run-length encoded string
A string is stored run-length encoded, like "B1A2E3C1" for BAAEEEC. Return the character at a given index without decoding the string. Follow-up: many queries; precompute prefix sums of run lengths and binary search.
No answer yet. Write the first one; the best answer gets endorsed.