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.
All languages have been fixed
you need to filter the children based on if a child is in santas list or not.
Additionally, the problem statement says that it must be case sensitive i think
@dinglemouse raised this already, Thanks for pointing it anyway )
In the real world, we make all kinds of assumptions, we just don't even recognise them anymore.
"Start with the initial value; apply
f
for every value in the list" relies on the assumption that applying zero times is valid. Which it is. This is not even an edge case, it's a base case.null
meansempty
; it definitely is data - all of none of it. Zero has been invented for a while.It might be easier to reason about
[]
then aboutnull
.If your Strings have a length of Integer.MAX_VALUE, you really will have other problems with this code.
Fixed!
There is something to apply, it's just you need to apply it zero times.
It's your problem to handle correctly the edge cases. Many approaches work perfectly here, if your doesn't and throws an exception then change it or do whatever you want, but there's absolutely no reason to specify anything more in the description since it's just do what you're asked to do.
The description doesn't leave a lingering doubt about that:
return the result of applying the given function on every element with the accumulating result, starting with the initial value.
Yes, it appears that there was an overflow problem with the Java translation.
I (original author, but not of Java translation) have now changed the Java translation to use long integers, I am hoping that this doesn't cause a problem with previous solutions.
Never recognized that before, thanks for letting us know! :-)
That's not the same input, the first fighter is different.
this has been witten with Java 8. Nothing like this at that time. ;)
Thank you! I'm happy to know that you like my katas!
https://github.com/codewars/codewars.com/issues/2534
Loading more items...