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.
If this is the improved description, I can only imagine how horrible the original description must have been.
Haskell translation
A language-specific snippet was added to the end of description.
so my indexing doesnt want to work, it says it is incorrect cous it is touple format and i do it as following: pairs[0,0] and it gives me an erroer. any solutions?
I am morally opposed to bare
it
s, fight me :pI'll take your word for it that it's all possible situations.
Forget, passed after rereading
Sorry
what about now?
you're absolutely right, please change that to use sample, there should be no duplicate choices, and then please self-approve that if there's nothing else that's jumping out at you.
I'm slightly mad about that you wrapped it up in a describe but that's okay.
the rationale with it is that those are all possible situations, any other combination/permutation one can come up with will be identical but with renamed symbols
This should do what you want in a more concise fashion. I'm not entirely sure what it is you want this for because we're super sleep deprived but the two are equivalent.
I'm pretty sure I can make the permutation generator you wrote nicer as well if you give me a second.
Approved it, but are you sure you wanted to do
random.choices(fruit_names, k=7)
rather thanrandom.sample(fruit_names, k=7)
?I don't hate the task itself though. Mind pressing green button on my fork? Swapped out description, changed to tuples for pairs, fully rewrote tests. Borderline too many random tests but I think I covered all unique cases so I like it that way. I addressed all of points 1 through 5. (stole+edited your solution as reference.. I suppose it's identical to mine. that was the process though xD) Maybe not even a terrible kata after this?
The mismatch is in that the author claims we should test for your point
2
, but their own refsol does not test for it and instead considers any set of three completable trades to be valid - ie according the refsolab,bc,cd
is a valid input. They claimed in the discourse that this explicitly was not valid.Honestly we should just get this crap retired, it isn't even a good task.
Hi
sorry, but unable tu understand the results of the task "buy" even with the tries of explanation below :
when you begin with harvested apple and buy orange , have you only orange at this moment or apple+orange in your stock ?
For some reason I took a stab at writing a description, it's probably terrible:
You've harvested a fruit.
But the Internal Raisin Service (IRS) doesn't allow you to eat your own produce, you have to launder it on the market first.
When you visit the market, you are given three conversion offers, and for each conversion offer you must decide which direction to trade.
A conversion offer is a pair of fruits, and to buy the second fruit for the first fruit, the action is
"buy"
The opposite direction is
"sell"
.["apple", "orange"]
If you have an apple, then you may buy an orange, or, if you have an orange, you may sell it for the apple.
As input you receive three conversion offers and your harvested fruit, and your output is a list of three actions of buy/sell, for the above example the output is:
["buy", "buy", "sell"]
.If it is not possible to end up with the original kind of fruit again after the three conversions, return "ERROR" instead of the list of actions.
I don't see the mismatch.. I have some observations though:
with_error
andwithout_error
isn't a loop, it only runs once - or if it would loop, then it would be able to return None[['a', 'b'], ['b', 'c'], ['c', 'd']], 'a'
with expected an expected outcome of'ERROR'
as d is not a['a', 'a']
I don't think the kata deserves to stay listed.
Loading more items...