[LC] Updated solution to search a 2d matrix.