Beta
Clean your shoes rack
15smolen
Loading description...
Fundamentals
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.
Node 18. (
mocha + chai
) should be enabledTests are vulnerable to input modification
For the 2nd example test case:
The feedback I'm getting is
Rack is missing some valid shoes
. Based on the Description, the rack should be empty because there are no complete pairs. What am I missing?Indeed empty rack should be a valid solution.
If you returned valid empty rack as a solution its bug in the testing "framework".
I will investigate it asap.
Do you manipulate array values directly?maybe its because you change original array and it yields such result. Its first idea that comes to my mind.
My solution doesn't mutate the input.
Description :
If both shoes are valid shoes but are not matched which way are they reordered, which pair goes in which shelf (which one moves and which one stays)?
If only one shoe is valid, what determines the shelf that contains the pair and which shelf gets empty?
Are you supposed to return an array of nulls for no shoes, or an empty array?
The only way to solve this is to just keep guessing, that seems not a coding challenge but a patience one, unless this is supposed to be some kind of puzzle where you are supposed to figure out the cleaning pattern of some oddly habited housekeeper.
Thanks for the feedback.
The order of the pairs of shoes does not really matter.Only what matter is that the left shoe has to be on the left side in the shelf spot and the right shoe on the right side.
If you remove some shoe from the shelf, the null value has to be set as replacement.
Basically you have to remove damaged and unpaired shoes from the shelf.The order of the pairs does not matter because each housekeeper has its own favorite system.
I hope it helps, i am going to try to improve description.
Cheers!
JS :
What do you mean ?
It does run with initial code but it does not passes the tests.I have chosen to throw an error if the solution is not correct. Maybe the error message is not very specific but i guess it should guide you for the correct solution.
Cheers!
Error message is not informative
You need to tell us what are missing to help debug
I was thinking to provide more specific errors, but then the kata would be easier to solve i guess.Debugging on your own is also the skill to improve.Am i wrong|lazy?
As long as the user knows what he's looking for, yes. But it rather seems that you do not provide all the needed information, for now.
@Blind4Basics
I agree, i have tried to include everything in the description.If the description is not so clear i will going to work on it.Only one warrior attempt to solve this kata and he managed to solved this so its hard to me to guess if the description needs to improve.
But if noone else will try to solve this it may be due to lack of test examples and bad description.I will try to improve it soon.
Cheers!
Missing sample tests.
Sample tests is where we usually put fixed tests to help doing TDD
Thanks for the feedback.
Is there any way for providing preloaded code in test examples? i would like to add custom test function that tests solution.
I would work on error messages to be more informative.
Anyway if the description is somewhat clear the test examples can be made by the solver.Is it necessary to provide such tests for this kata?
If you need your own functions to test the results, you could just put them in the sample tests if they are not spoilers Or you can just put to the
Preload
section which cannot be directly accessed by users And for cases with few posibilities, you can just doing fixed tests in sample tests section without custom test functions, likeThanks, i have added a preloaded function for testing the solution.You can test you output of your solution this way.