Solution for numbersearch problem