题解 | #二维数组中的查找#
二维数组中的查找
https://www.nowcoder.com/practice/abc3fe2ce8e146608e868a70efebf62e
public class Solution { public boolean Find(int target, int [][] array) { if(array.length==0){ return false; } boolean flag=false; break1:for (int i = 0; i < array.length; i++) { for (int j = 0; j < array[i].length; j++) { if(target==array[i][j]){ flag = true; break break1; } } } if(flag){ return true; }else{ return false; } } }