Ad
  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    Just saying, I'm aware of BigInteger and there's no reason not to use it - just never done something like this before 👍

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar
  • Custom User Avatar

    That seems overly complex

  • Custom User Avatar

    As you are using Linq, you can use it to output the number in a single line without needing to create lists, you can find out if the number you are looking for is odd or even (integers.Where(x => x % 2 == 0).Count() > 1 ? 1 : 0) so if this is 1 then we look for odd and 0 for even, we can then find where a variable fits the criteria integers.Where(z => (z % 2 == (*that code snippit before*))) and get the only value .First();, so now we have odd if the only number is odd and even if the only number is even.

    Great start with Linq

  • Custom User Avatar

    As you are using Linq, you can use it to output the number in a single line without needing to create lists, you can find out if the number you are looking for is odd or even (integers.Where(x => x % 2 == 0).Count() > 1 ? 1 : 0) so if this is 1 then we look for odd and 0 for even, we can then find where a variable fits the criteria integers.Where(z => (z % 2 == (*that code snippit before*))) and get the only value .First();, so now we have odd if the only number is odd and even if the only number is even.

    Great start with Linq

  • Custom User Avatar

    As you are using Linq, you can use it to output the number in a single line without needing to create lists, you can find out if the number you are looking for is odd or even (integers.Where(x => x % 2 == 0).Count() > 1 ? 1 : 0) so if this is 1 then we look for odd and 0 for even, we can then find where a variable fits the criteria integers.Where(z => (z % 2 == (*that code snippit before*))) and get the only value .First();, so now we have odd if the only number is odd and even if the only number is even.

    Yours is way clearer though :P

  • Custom User Avatar

    As you are using Linq, you can use it to output the number in a single line without needing to create lists, you can find out if the number you are looking for is odd or even (integers.Where(x => x % 2 == 0).Count() > 1 ? 1 : 0) so if this is 1 then we look for odd and 0 for even, we can then find where a variable fits the criteria integers.Where(z => (z % 2 == (*that code snippit before*))) and get the only value .First();, so now we have odd if the only number is odd and even if the only number is even.

    Great start with Linq

  • Custom User Avatar

    As you are using Linq, you can use it to output the number in a single line without needing to create lists, you can find out if the number you are looking for is odd or even (integers.Where(x => x % 2 == 0).Count() > 1 ? 1 : 0) so if this is 1 then we look for odd and 0 for even, we can then find where a variable fits the criteria integers.Where(z => (z % 2 == (*that code snippit before*))) and get the only value .First();, so now we have odd if the only number is odd and even if the only number is even.

    Great start with Linq

  • Custom User Avatar

    As you are using Linq, you can use it to output the number in a single line without needing to create lists, you can find out if the number you are looking for is odd or even (integers.Where(x => x % 2 == 0).Count() > 1 ? 1 : 0) so if this is 1 then we look for odd and 0 for even, we can then find where a variable fits the criteria integers.Where(z => (z % 2 == (*that code snippit before*))) and get the only value .First();, so now we have odd if the only number is odd and even if the only number is even.

    Great start with Linq

  • Custom User Avatar

    (integers.Where(x => x % 2 == 0).Count() > 1 ? 1 : 0)
    This bit will give a 1 if the number you are looking for is odd and 0 if you are looking for an even number (from asking if there are more than 1 even number with)
    Using this we can find the 1 number in the array that matches this