public class Solution{ public boolean Find(int target, int [][] array){ if(array == null || array.length == 0 || array[0].length ==0) return false; int rows = array.length, columns = array[0].length; int row = 0 , column = columns - 1; while(row < rows && column >= 0){ if(target == array[row][column]) return true; else if(target < array[row][column]) column--; else row++; } return false; } }
原文:https://www.cnblogs.com/MiaoPlus/p/10707060.html