it's the other way around; pay attention to the dates (you can see them at the bottom of the Details page). Kata authors cannot unpublish approved katas anyways so deduplication is handled on github
Ha, good question! As far as I was able to discover, it's about assigning a total value to each giver's gifts. If a gift doesn't occur in the list of gift ranks, it receives no value. But if it does occur in the list of gift ranks, its value is a power of two, with its index in the list of gift ranks used as the exponent. Finally, order the givers from lowest total gift value to highest total gift value and return their names in that order.
The task is complicated by the fact that multiple givers can have the same name, and by the fact that the list used in the input is structured in a bizarre way, with the giver's name in the last position, preceded by any possible number of gifts.
Thanks for your comments. I'll address them one by one, but in general I'll point out that the intention of this kata was to reflect the reality of this seasonal task. If you keep that in mind, some of these responses will make more sense:
Yes, the example is long, but not nearly as long as the actual raking/burning season. I will change the text to encourage the student to study only as much of it as necessary until they understand how it works. Hopefully no one will feel obligated to read the whole thing if they don't really need to.
It was my intention to include a variety of weather conditions and give the student a realistic idea of the complexity of the situation. In my opinion, the example wouldn't be worth much otherwise.
I like your suggestion about showing the tuple for each day. (It's actually a list.) I will do that.
The only other kind of precipitation we get during that season in this area is mist. I'll add that, too.
The directions reflect the reality of the situation. Students who recognize that the directions all start with the same letter are rewarded by being able to write their solutions just a little shorter. I actually like that aspect of it.
This could alternatively be fixed by changing the spec to accept any longest zero-sum substring ( a subsequence is something else ). That would not invalidate any solutions.
This would need to be done for all languages. I can do it for JS but not CS.
Thanks. I've updated the kata description. Is it clear now?
The third sentence in the kata states: "There's a preloaded dictionary called alpha which you can use. Keys are lower case letters and the space."
Fixed for Python.
it's the other way around; pay attention to the dates (you can see them at the bottom of the
Details
page). Kata authors cannot unpublish approved katas anyways so deduplication is handled on githubHa, good question! As far as I was able to discover, it's about assigning a total value to each giver's gifts. If a gift doesn't occur in the list of gift ranks, it receives no value. But if it does occur in the list of gift ranks, its value is a power of two, with its index in the list of gift ranks used as the exponent. Finally, order the givers from lowest total gift value to highest total gift value and return their names in that order.
The task is complicated by the fact that multiple givers can have the same name, and by the fact that the list used in the input is structured in a bizarre way, with the giver's name in the last position, preceded by any possible number of gifts.
I hope this helps anyone trying to figure it out.
Can anyone else other than the author explain what this kata is about?
I added it. Thanks for the suggestion.
Thanks for your comments. I'll address them one by one, but in general I'll point out that the intention of this kata was to reflect the reality of this seasonal task. If you keep that in mind, some of these responses will make more sense:
There Is no possibility for a name to be the same as element of the gift.
This could alternatively be fixed by changing the spec to accept any longest zero-sum substring ( a subsequence is something else ). That would not invalidate any solutions.
This would need to be done for all languages. I can do it for JS but not CS.
Fix: https://www.codewars.com/kumite/6522e9d5e650909141f1bc66?sel=6522e9d5e650909141f1bc66
You are welcome!