public class Solution { public boolean Find(int t, int [][] a) { int x= a.length-1; for(int y=0;y>=0 && y<=a[0].length -1 && x>=0;){ if(a[x][y]==t) return true; else if(a[x][y]<t) y++; else x--; } return false; } }