Java language.
/**
* This is a modified binary search that compares a key Stringwith the first key length
* characters of the Strings in the vals array.
*
* This search does not distinguish between two Strings that havethe same first letters
* as key. So for a key of “David”, “David Johnson” and “DavidLetterman” would both
* count as equal to the key.
*
* This search uses the lexicographic ordering specified byString compareTo.
*
* Assumes vals is sorted in ascending order.
*
* @param vals : an array of phrases
* @param key : the start of a phrase.
* @return the index where the start of val matches key, or
PayPal Gateway not configured
PayPal Gateway not configured