Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
i have to find an integer which appears an odd number of times in an array. what am i doing wrong.help!
public class FindOdd
{
public static int findIt(int[] a)
{
int odd,b;
for(int i=0;i<a.length;i++)
{
odd=1;
b=a[i];
for(int j=i+1;j<a.length;j++)
{
if(b==a[j])
{
odd++;
}
}
if(odd%2!=0)
break;
else
continue;
}
return b;
}
}