二维数组中的查找 hashset方法
class Solution {
public boolean findNumberIn2DArray(int[][] matrix, int target) {
int row = matrix.length;
if(matrix.length == 0){
return false;
}
int colum = matrix[0].length;
HashSet<Integer> mtx = new HashSet<Integer>();
for(int i = 0; i < row; i++){
for(int j = 0; j < colum; j++){
mtx.add(matrix[i][j]);
}
}
return mtx.contains(target);
}
}