Retired
Chicken crossing the road (retired)
18 of 19KK201431873
Loading description...
Puzzles
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.
Please everyone who downvoted reconsider, I know there were a lot of issues with this before but they're fixed now :)
It's not said in the description that the left column will never have
'o'
inside it. It should be told.Forgot about saying that, thanks for catching it!
You will be given an
n x 2
2-D array in which:n
is the number of rows in the array'x'
will be the chicken'o'
will be an obstacles'0'
will be an empty space.Using these directions:
'U'
for up'D'
for down'R'
for rightreturn a list which shows the path the chicken must follow in order to avoid obstacles and make it to the other side with the shortest route.
If there are multiple routes with the same length, choose the topmost one.
It is guaranteed that the chicken will be on the left side, and that there will be a route or routes to the right.
Thanks for the suggestion! This might save some brain energy when trying to understand the kata
C++ version has been removed due to inconvenience, it will be added back later, when all issues are resolved
...holy... xo
Guys, when I tell you that this and that fixed tests are missing, I mean those specific tests. Meaning choosing to use only 2 of the 5-7 I gave isn't a good idea.
fixed tests
!=sample tests
!=test suite
. Currently, you have 3 fixed tests in the sample tests, and 0 fixed tests in the test suite.This is still here!?
=> coordonate your actions. You're both overwritting your changes...
Sorry, man. The issues here should be fixed. I'm going to leave this issue here so that if there are more problems (which there probably will be x{ ), you can comment here.
nx2
, a lot of cases are missing in the fixed tests:For the random test cases, we coded it to have n>=3, since the return would just be "R" if n=1, and n=2 would have only four possibilities. Sorry in hindsight for the confusion, we thought that it might be a little pointless to test the smaller n cases. Also I just finished adding the larger board fixed tests, thanks for the suggestion!
More longer-length tests and 1x2 and 2x2 tests have been added :)
guys, what are you doing...? x/
there are no fixed tests now! => put them there again
and an advise: build a single function for the random tests and call it with different values for the argument. What you did there is code duplication and isn't a good practice.
Not sure about the lack of fixed tests, on my end they appear. Thanks for the advice though!
Code duplication is removed :)
n
while this info is directly accessible throughlen(road)
...? xs => it's python, not C => stick to one single argument.Should be fixed now :)
?
you need to use a
it
ordescribe
block for the random tests tooYes, I've done that now. I've also added more longer-length tests :)
The issue below is still not fixed:
https://www.codewars.com/kata/reviews/5fbc7162e130810001dc1b17/groups/5fbd2b0e8f14990001e7e3dc
That solution and the previous one that this issue was opened with are both marked invalid now, and the tester code is using a deepcopy. Maybe try again?
no. Because of this:
Ah. Thanks for the catch, it's fixed now :)
(yup. But this would have been much simpler...)
And, just remove the printing, it's useless. Or only print the input, and not the output: if the ouput is incorrect, the assertion message will show it all the same.
User can modify the input:
https://www.codewars.com/kata/reviews/5fbc7162e130810001dc1b17/groups/5fbcdea4247f5c0001f4113f
Hm.. That's weird, the update didn't save. It should be fixed now.
Still not fixed yet.
It's fine on my end. Maybe try again?
After the update:
From description:
Thanks for the catch, now it should be fixed!
It should be mentioned that input is always 3 x 2 list (although, why not make it more general?)
There are already many 3-5kyu "shortest path/find exit with obstacles". IMHO this kata makes sense only if it remain simple, 3 x 2 or (better) n x 2, but non n x m.
Fixed, I'll ask the kata creator about making it more general, but for now I just added the 3x2 part to the description :)
it's still not said that the roads always are 3x2.
And I agree with mauro-1, this problem is only valuable (for cw) if the road is
nx2
.I agree with n x 2, fixed 3 x 2 is too simple IMO.
@Blind4Basics For some reason Codewars isn't sasving my changes. I changed it to say 3x2 and now it doesn't :l It should be fixed now.
@B1ts I think the concept is simple for 3x2, but is harder to implement than many current 7kyus
Why does it have to be a 7? It could be a 6. Although, I'm not sure it would be worth that even with n x 2.
Sure, it will be updated to do nx2, although the solution is similar with 3x2 and nx2
User can modify the input.
Fixed
This issue hasn't been fixed yet.
Sample tests in python use 0 then attempts use '0'.
Actually they are mixed up in sample tests.
Fixed
Testing are inadequete in both C++ and python For example:
is not being tested.
I totally agree with you, so I might add it to a future version or update this one. Otherwise, I guess my former idea here was a little too simple, since having both o's be on the right side would be easy to overcome.
This version is not supposed to have that test case happen at all.
No sample tests in C++
Fixed
C++ translation added as a "contribution" because kata creator has gone to sleep :P
Please check the issue raised above regarding C++.
It's a good thing to avoid creating translaions directly with kata editor, and skipping the usual translation mechanism. Language versions added directly with the editor cannot be easily forked afterwards. Now the only way your C++ translation can be fixed is entering the kata editor, and not everyone can do this.
You've gauranteed that chicken will be on left side, but in some inputs there are no chickens at all.
Other than that:
Who am I giving path to, when there is no chicken in the first place?
(I ain't mutating the input)
Should be fixed now :)