You are viewing a single comment's thread. Return to all comments →
solution for all the testcase including urs..
for(int k=0;k<=R-r;k++) { end=c; start=0; while(end<=C){ if(G[k].substring(start,end).equals(P[0])){ for(int i=1;i<r;i++) { if(G[k+i].substring(start,end).equals(P[i])) count++; if(count==r-1)result=true; } } count=0; end++; start++; } } if(result) System.out.println("YES"); else System.out.println("NO"); }
Seems like cookies are disabled on this browser, please enable them to open this website
The Grid Search
You are viewing a single comment's thread. Return to all comments →
solution for all the testcase including urs..