optimize string search on black-box function Given a lower-bound predicate function which returns true if an input is greater than or equal to a constant string, what is the optimal way to search for the constant? The strings should be lexicographical compared.

For example, given a handle to the following function, but not knowing the specific constant used:

fn lower_bound(s: &amp;[u8]) -&gt; bool {
    s &gt;= &amp;[10, 20, 30]
}


What is the optimal algorithm for determining the enclosed value of &amp;[10, 20, 30]?  A maximum length for the value can be assumed if that makes it more tractable.
The most optimal algorithm would be to perform a binary search for each character sequentially (bin-search for 1st char, bin-search for 2nd char, ...etc).