7 kyu
Clean up after your dog
2,561 of 5,099PG1
Loading description...
Fundamentals
Strings
Arrays
Mathematics
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.
In Java version the method signature has String type as agument of garden, but it should be char type.
Also there are random test cases which expect Dog return even though Crap scenario happens earlier in the input. It is not made clear in the description how to handle this case.
Otherwise i really enjoyed this one :)
This comment has been hidden.
I got it wrong first time around in JavaScript with the message: -expected "Cr@p" to equal "Clean" with bags 5 cap 0- Which made me scratch my head a bit. Pressed one more time, and everything went green. Anyone else had that experience?
Translate Dart check the solution
the author's description talks about one dog, but in random python tests there may be more than one dog
What the hell is this? I have 1 crap, 0 bags, and 2 cap. But the expected value is still Clean even though it is already stated in the instructions that if there are no bags, ignore cap since you cannot pick any crap up. So technically, it should be Cr@p!
What a piece of Cr@p!
Please, when reporting an issue state the language too, so it's easier to check.
It's C#
Java translation
Groovy Translation
I also modified the description to be a little more readable
great, thanks
This comment has been hidden.
If the yard starts out clean (no cr@p), shouldn't you not care whether your dog is there or not and just be able to return 'clean'?
In Kotlin:
countCrap = 3 countDog = 0 totalCap = 3 expected:<C[r@p]> but was:<C[lean]>
Why?
What's the number of bags? Please delete the repeated post, it seems to be the same problem.
Thank you very much for your reply!
I've resolved the issue.
Thank you.
Ruby 3.0 should be enabled.
fixed
Nice kata!!!
Forked python translation with new test framework used and 3.8 enabled ~~
Approved, thanks
__ __ __ @@@ @_@
@_____ _____@ @@
Expected: "Dog!!" Actual: "Cr@p" Please explain why dog?!
Remember to state the language you're having troubles with.
Sorry,it waz Kotlin
The tests seem ok, I think it's a problem with your code, when pasting code here, please use markdown formatting as seen here
Use the following code to print the input (note that it logs all the tests until it reaches the one your code fails, so take a look at the last one)
i just solved it and i was confused at cases if
Thanks:)
Hello, I am trying this kata in kotlin, and I pass all the normal tests but random tests always fail and I don't know why. I'm new to codewars, so I just wanna ask can I somehow check what that random test was so I can indentify why it doesn't work? I have aboslutely no idea why it fails...
I found the error, was pretty dumb of me, but still I'd liek to know if there is a way to find out what random test have I failed for future Katas. Thanks in advance :)
You just need to log the test input out to the console so you can see the test case. Not sure of the syntax for kotlin, but for javascript, something like:
function x(input){ console.log(input); }
You'll find codewars a lot easier now :)
Kotlin Translation
Please, review and approve/comment
Approved, thanks
haskell : https://www.codewars.com/kumite/5bea3c2efc0bc42a2b00014c?sel=5bea3c2efc0bc42a2b00014c
Approved
Translation improved
A similar kata if you liked this one: https://www.codewars.com/kata/cat-and-mouse-2d-version/
C# translation Kumited, please review and approve.
Approved
Description is a bit vague.
If there are no bags, you can ignore cap.
Does this mean you can pick up an infinite amount of cr@p if you have 0 bags, or would you still be able to pick up nothing?
It just means you can pick up nothing if
bags == 0
, no matter whatcap
is. Maybe deleting that line in the description would be better.Edited, thanks for flagging
Being myself a dog-owner, I greatly enjoyed the kata. Thanks.
Glad you enjoyed :D
Python and Ruby translations available.
And Crystal as well.
Approved, approved, approved
We shall see in the next round!