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.
True, but an array can be initialized with null, then you will get NullPointerException:
String[] test = null;
and considering there was a test
i'd go for a null check before returning.
One of the assumptions in the details was the you were given an array.
That error IS strange. Unfortunately I have no idea what to debug. Can you please share your code? You can mark it as a spoiler and it should stay hidden.
Thank you! I'll stick toLowerCamelCaseFromNowOn ;)
@liry
Thanks for feedback!
What is the current standard in Java to start member names? Or there is none? (Please do not direct me to stack-overflow-like-pages because the answers there are very inconsistent ;) )
All info appreciated.
I am a C# developer trying out Java and ... old habits die hard ;)
You're right. I forgot to pass the initial 0 to inject. Should have been:
def squareSum(numbers)
numbers.inject(0) { |sum,x| sum + x**2 }
end