stl solution to searchRange