All pastes #2073334 Raw Edit

Mine

public text v1 · immutable
#2073334 ·published 2011-06-01 18:28 UTC
rendered paste body

public static boolean test(int [][] m) 
{
   int n=m.length; 
   for(int r=0; r<(n-1); r++) 
 for (int c=0; c<n; c++) 
  for (int i=0; i<n; i++) 
   if(m[r][c] > m[r+1][i]) return false; 
   return true; 
}

Given array m returns true, I need to write a search code that will go through the array and return true if a certain number is there, and false if it isn't. It has to be O(n).