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.
Don't post code here, use that kata discourse and mark your post as having spoiler content.
Don't post code here, use that kata discourse and mark your post as having spoiler content.
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;
}
}
I have passed 28 tests but failed 4 tests for - "Playing with digits" kata.
I don't find the correct solution anywhere on the site.
Wanted to check if the correct solution is available after attempting a kata or no?