6 kyu
Help Suzuki purchase his Tofu!
426 of 936user8476848
Loading description...
Algorithms
Data Structures
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.
I get that the instruction says he has to pay the exact price, but what does this say about the Tofu vendor?
Quite fancy kata of the series, well done.
From all that has been said, I realized that in the example cost = 124 box = 'mon mon mon mon mon apple mon mon mon mon mon mon mon monme mon mon monme mon mon mon mon cloth monme mon mon mon mon mon mon mon mon cloth mon mon monme mon mon mon mon monme mon mon mon mon mon mon mon mon mon mon mon mon mon'
is returning
[45, 5, 345, 6] 45 - number of mon 5 - the amount of monme 345 - the sum of mon and monme 6 is the amount of tofu that can be bought with 345 coins, Maybe I'm wrong, but if 345/124 = ~2 what does the number 6 mean??
The description should probably get a touch-up, it is difficult to find what the return value should be when skimming it. But it does say as part of the example what those numbers are.
This comment has been hidden.
This comment has been hidden.
This comment has been hidden.
Java translation
CoffeeScript translation
Ruby 3.0 should be enabled.
Enabled in this fork
This killed me.... so close for so long yet so far. Thanks for a great one!
The kata was very nice but description not that clear. Should have been included an example of the output in the same description of the kata.
I have finished the kumite please accept the translation..https://www.codewars.com/kumite/583d0ccaf3006599cd0003b6?sel=583d0ccaf3006599cd0003b6
Hi Ze-Marcos, Will you please go into the editor and submit the translation? This is where the tests are ran and also the only way for you to receive honor for the translation. Also, I did not see random tests. Those are required as well. All my kata have random tests.
Hi,
Kata test cases miss one test : you never check for the exact change, when cost < N(mon)+N(monme)*60 (lechevalier's solution did pass despite being wrong)
I just ran the test and it looks like his solution did indeed slip past one of the random tests. I will create a new basic test for these inputs today.Thanks
Another good suggestion I have added this test case to my Kata and all translations. Would you mind marking resolved?
Done !
Thank you!
This comment has been hidden.
This comment has been hidden.
:) Thanks for the welcome!
JS version seems still has problem:
I think suzuki has no 55 mon ;-)
@GiacomoSorbi please check.
Yes I double checked and the Python Kata returns "leaving the market" as it should. Need @GiacomoSorbi to update Javascript and Ruby versions. Sorry I do not want to try and pick apart his awesome one-liners....
Fixed, cheers!
Thanks Giacomo!
Issue resolved.
In random tests there're some expected results I don't understand :
Then why are you expecting 52 ? ? ?
Same to me, think it' s an issue... One little "and" part at "if" statement helped;-)...
I needed to make a change to avoid future confusion as I can foresee a situation where someone will always just return an extra monme if they have one. I also found issues with certain cases. So the requirement is to use exact change or leave the market. Hope you dont mind the change since it's the first day this Kata is in Beta.
And both translations submitted; if you want to take more from my basic tests, just be my guest.
In the future I would stick to katas returning the same kind of object, not an array or a string accordingly to the condition, but it was nice for a change.
Cheers!
Neat idea and I am definitely going to translate this one, but need more base test cases (for example when I have few monme and need to use a s**tload of mons to pay for my bento.
Also, I think in English you spell it "monastery": you know afterall it is still stuff invented by Italians like crusades, inquisition, mafia and fascism: I can tell :p
translations approved thanks for catching the spelling error. It was a late saturday night .... noted on the return as well.
Oh, cool: I see I am not the only one doing vampiric coding even in the weekend.
Not sure what you meant on "noted on the return", but glad to be of help :)
Giacomo please ensure JS and Ruby translations have Stewart leaving the market if they do not have exact change. Thanks
Hi Giacomo...will you be able to update the Javascript and Ruby translations so we can close the issue? Thank you...
Oh, I was not notified here; ok, can do that later!
thanks Giacomo!