solution 2 for Search a 2D Matrix