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.
Yeah this is great! I would be happy to work with this person :]
Easily understandable. Learned from this. Thanks!
I believe the only parts missing are the definitions of constants for the cost of a day and the various discounts. Perhaps also consider using the ternary operator in the discountRate function.
"more code" isn't a big deal if it's not increasing complexity. sure he could have perhaps used ternaries instead of if-else, but what i see at work here is the prevailing desirability of standard syntax.
I really do like it!
This comment is hidden because it contains spoiler information about the solution
Still too much. My solution is just as readable (if not more so) and has way less code. I'm open to see better ones but this ain't it imo
ty for the explanation, context is king then.
Nice naming and readability.
To those who are asking if this is too bloated, consider that context is probably your best friend here. For a standard kata it's too much. For a business that maybe applies or removes discount rates that vary, this code seems really good because it's flexible and separates each function as needed. Context in all things.
Because a group of people all had this exact same solution and they probably upvoted it themselves.
Clever code!
Performance on a simple calc like this honestly wouldn't make any difference
this solution is incorrect, it saves only last value.
I mean it's not bad, but I wouldn't say it's best practice, as it's marked
Loading more items...