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.
Just some personal opinions:
Specifying how priority encoding works is no longer necessary. You can do it, but solvers don't need that information any more, so it can't help and might hurt them to have to read it.
Bullet points (1) and (4) in the first list seem redundant.
Bullets (2) and (3) in the second list are actually children of the first bullet. Would it be possible to add another layer of indentation there?
Added tests to validate that the function throws errors on invalid input, such as duplicate values with different priorities
Throwing errors isn't tested.
I have corrected the description, is there anything else that needs to be corrected?
so let me add the markup to the description and then we'll look at it again and you can ask questions if you have any because I'm also confused
Wait, did the specs change? I just noticed that both value and priority should match. Was that there the whole time?
I would suggest only testing valid inputs. Input validation has been done to death in other kata, and is just an unrelated additional task. "Do one thing, and do it well." Focus the kata on one, and only one, task, esp. for lower level kata.
absolutely right :) I changed the example and description to suit your issue. If you still have questions, write it :)
Description is now a wall of flat text. Can we have some markup please?
I think you misunderstood ( or, possibly, I did :)
Higher number means higher priority. But for
value: 1
,priority: 2
was chosen whenpriority: 3
is available.The example seems to have been changed, and now
value: 1
is not in the expected result at all ?!?The description has been updated to clearly specify the concept of sets and their constraints, and the function signature is now presented separately from the examples for clarity. Thank you for the feedback!
Each set contains unique values. If there are multiple entries with the same value but different priorities, it should be considered invalid and throw an error
"Thank you for the feedback! I have clarified in the description that each set should contain unique values, meaning no duplicate values are allowed within a set, regardless of priority. If a value appears multiple times in a set with different priorities, it will be considered invalid, and an error will be thrown."
Encoding a set as an array of objects leaves open the possibility that either set may contain multiple identical values, possibly with identical or different priorities. Please specify what can and can not happen, and how this impacts the expected result.
Loading more items...