You are viewing a single comment's thread. Return to all comments →
my solution
static int[] acmTeam(String[] topic) { int count=0,max=0;
for(int i=0;i<topic.length;i++){ for(int j=i+1;j<topic.length;j++){ char a[]=topic[i].toCharArray(); char b[]=topic[j].toCharArray(); int num=0; for(int y=0;y<a.length;y++){ int u=Character.getNumericValue(a[y]) ; int uy = Character.getNumericValue(b[y]); boolean ch=false; if(u==1 || uy==1) ch=true; if(ch==true){ num++; } } if(num>max){ max=num; count=1; } else if(max==num){ count++; } } } int r[]=new int[2]; r[0]=max; r[1]=count; return r; }
Seems like cookies are disabled on this browser, please enable them to open this website
ACM ICPC Team
You are viewing a single comment's thread. Return to all comments →
my solution
static int[] acmTeam(String[] topic) { int count=0,max=0;