Solution to Search 2D Matrix