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 is smart. I wish I knew about this earlier in my life.
Yes, but that is even and it will send Even as the output instead of 0 for an empty array.
And comparing them with your score, both are lower.
@adrian-lui
classPoints [1, 1, 1, 1]
yourPoints 5
average with yourPoints = (1 + 1 + 1 + 1 + 5) / 5 = 1,8
with out yourPoints = (1 + 1 + 1 + 1) / 4 = 1
Note: Your points are not included in the array of your class's points. Do not forget them when calculating the average score!
will return a float not an integer
Tad bit late on this, but hopefully helpful for future users:
The way this function is written is in the arrow function form but it's ultimately the exact same thing as doing the regular function declaration form that you wrote. Just returns 1 line instead and makes the code look more clean.
Good job!
Implemented the same solution, but used IntStream instead of Arrays.stream!
devils in the detail with this one
If a project can last longer than an average civilization, it should be stated so. Either lose the performance constraints, or add a tag and sufficient huge random tests
This comment is hidden because it contains spoiler information about the solution
He meant the logic of solution would not be valid anymore, but still genius as it has 0.5 =)
This answer is what the kata asked for, not the top voted solution. I think this should be top voted.
LOL I feel the same! Our solutions are exactly the same hahah! As Reda12345 said, we all have diffenrent logic but as long as it works you're good :) I was being harsh to myself too, but i'm going to take my own advice now and be proud of myself for finding a solution at least lol even if it's not the shortest code!
Loading more items...