Solution for Problem 8 - recursive bisection character search