Ad
  • Default User Avatar

    Also worth noting that when you post this code on the respective kata, use the tilde key (`) three times to start a code block, and another three times at the end. You can optionally include the language used after the first set of tildes to have highlighting enabled. Using code blocks makes it much more readable.

  • Custom User Avatar

    Don't post code here, use that kata discourse and mark your post as having spoiler content.

  • Default User Avatar

    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;
    }
    }