added solution for search in a range