solution to Search Insert Position