public class Solution { public boolean Find(int target, int [][] array) { int col = array[0].length-1; int row = 0; while(col>=0 && row<array.length){ if(array[row][col] == target) return true; else if(array[row][col] > target) col--; else row++; } return false; } }