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.
That's not the downside. It follows the rules and could be "fixed" for other situations.
The real downside is Linq. It's slow and harder to read and maintain.
My code would be simple to adapt to any number of consecutive digits while being about twice as fast in execution.
Linq might have it's uses, I just haven't found any yet...
Yet more slow Linq. Why?
I wrote the same code but for some reason my test kept insisting I always returned 0 xD I even tried just returning elements of the input but it still said 0 every time.
my code looked something similar to this, but I couldn't get "numbers == null" to identify a null array. I had to use: "numbers?.Any() != true"
What counts is that you have solved the problem :)
you are correct. that part is redundant. also, one can terminate the program after the first text case and not even test for the second
Something like
if (word==true) { ... }
when the variableword
is itself a boolean is redundant - you can just writeif (word) { ... }
Edit: Ignore me if you were questioning the statement "don't use...", didn't take your meaning first at first read
I do agree there is alot wrong with this code. But what do you mean with "don't use the boolean property of the parameter"?
VERY slow? How is this very slow?
This is VERY slow. You do 2 checks, have too many curly braces, don't use the boolean property of the parameter etc.