Code for problem "Search a 2D Matrix".