Solution (source code)

= Solution

Let $m\geq1$ be the number of real contacts, and suppose the requested name is at position $j$, counting from one. The implementation above makes exactly $j$ name-equality comparisons, including the successful comparison; null checks are not <string> comparisons. Thus \b[the minimum is one, when the first real contact is requested, and the maximum is $m$, when the last is requested]. The <precondition> excludes unsuccessful recalls and recalls on an empty book. This counts calls to <string> equality, not individual character inspections within each call.