Beta
What will Agumon digivolve into? (Digimon World 1)
Loading description...
Games
Algorithms
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
This
1/10
uses integer division too, right? This can lead to different results in very specific edge cases, which should be clarified and (IMO should be) tested. The current edge cases doesn't specifically test for this part.I remember not being able to come up with a test case for this. As far as I can tell, you get the same result with either type of division because of the integer division in the top-level calculation. Consider the following scenario:
If we divide the HP "wrong", we get:
((299.9 + 150) + 0) / (2 + 0) = 449.9 / 2 = 224 /* 224.95 rounded down */
If we divide the HP "right", we get:
((299 + 150) + 0) / (2 + 0) = 449 / 2 = 224 /* 224.5 rounded down */
If there were another decimal in the calculation, we could get a different result, but:
Anything I'm missing?
Enjoyed this kata.
Test cases looks really well done, with fixed, boundary and randomised tests.
Took me a while to understand the requirements, and initially I thought there was not enough information in the description to solve the kata.
However I just had to read through it carefully to piece together the algorithm.
Perhaps the description could be improved to work through an example of calcuating the full score for an individual candidate champion? But perhaps understanding the requirements is just an intrisic part of the difficulty for this kata.
I think difficultly wise I'd go for 4kyu based on "Understanding intricate business requirements".