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.
This comment is hidden because it contains spoiler information about the solution
Because it is. Framework is there to use it. :)
Just saying, I'm aware of BigInteger and there's no reason not to use it - just never done something like this before 👍
This comment is hidden because it contains spoiler information about the solution
Please raise your code problems as a
question
and not anissue
;-)Your code has bug.
Check your comments again please ;)
This comment is hidden because it contains spoiler information about the solution
Whoops XD
Ok. Thanks for the comment.
Personally I don't like to nest commands inside commands. After some months, I'm sure I will forget the logic I have used :). Sometimes readability rewards you in a long term.
Your code will execute more linqs than mine :).
That seems overly complex
Thanks for your feedback. I am a Ruby developer and i was a .net developer just trying to refresh my .net skills. Will change as per your comment.
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 criteriaintegers.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
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 criteriaintegers.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
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 criteriaintegers.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
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 criteriaintegers.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
Loading more items...