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.
If there were no rules on the input, then that's probably a good idea. However, the description of the kata clearly states that the input will always be a non-begative integer, so the extra defensive code is unnecessary in this situation.
Yeah. It was in coffeescript when I was completing it. I'm not sure if it's fixed now, but it definitely caused some frustration at the time.
You have a function preloaded with user tests predefined, yet your submission tests are a diferent function.
The reduce function just takes a collection of values and returns a single value out the end, depending on the function you provide on the inside. In a nut shell, it starts out with what the answer should be, and subtracts the values that are given. In then end, the missing value is what is popped out the other end of the reduce.
There were a few problems I had with this kata. Firstly, I didn't like having to go find the mottos of the houses. It wasn't difficult, but I expect a kata to be pretty self contained so I can focus on the concepts. Secondly, it would be nice if there was a message explaining why a test case failed or show the expected result. Overall it was good though. A very nice intro.
I spent like 15 mintues working on this kata before I found out that codewars doesn't support the ** operator.