7 kyu
Coding 3min: Bug in Apple
1,606 of 2,721myjinxin2015
Loading description...
Puzzles
Games
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.
Not possible at this stage but returning tuple is more pythonic.
C Translation
approved
The minimum code length constraint (coffeescript) is a bit ridiculous.
I think the point is to avoid to have published solutions that spoil the hard version.
A rule which cannot be enforced is not a good rule.
I don't understand.
It's not possible to check code length with such constraints. I can just add long variable names or add comments to bypass this weak rule. Hence, such a rule is pointless.
Sure it's easy to make a code uselessly large. Though, I think it may be a good idea if it can warn users that they should not publish this solution for this kata and find a more basic larger one.
okay, so we are relying on goodwill of the user then
Asks for an answer [x, y]. But corrent answer is [y, x].
This was very fun kata!
The description is badly formatted.
Fixed.
coffeeScript translation Kumited! Please accept :D
approved, thanks ;-)
This is a fun series! Good work :)
;-)
code works for basic tests and the first few hidden tests, then I get Expected: [1,4], instead got: undefined on I think the 7th test of the 100 random tests. Is this an issue with the test or with my code? Is it not passing a valid array? Do we need to account for that?
Can you paste you code here? and mark it as having spoiler content.
This comment has been hidden.
You should know,
apple
is an 2D array. So, if you modified the second linej <= apple[0].length
, and then your code will work correct ;-)I can't test it, because CW's server doesn't work now.
EDIT:
++i
and++j
may bei++
andj++
, and<=
may be<
EDIT: If you use
++i
and<=
, wheni==apple.length
,apple[i] == undefined
, and thenapple[i][j]
will got an error.ahhhh that fixed it! Thanks!
Kata description says it return result
[x,y]
but test cases seem to be wanting[y,x]
(??)[x,y] here is just an example, it can be [a,b], or [i,j], is not what you think of the [x,y] which used for the coordinate system.
It means that if apple[x][y]="B", then return [x,y].
Since there is no test case where there isn't a 'bug' in the 'apple' maybe you should mention that in the katas description (or add a test case and expected return value if there isn't a 'bug' in the 'apple').
This comment has been hidden.
No problem.
Nice kata! I enjoy these short limitation challenges and will try the hard version. Rated and approved.
Thanks~~~
Just found the description very unclear
thanks for your feedback, but your suggestion is unclear too ;-)
this kata is basically a duplicate of your other kata, because you can remove the restrictions in the other kata which is the same as this one.
You know, i just split This kata to two difficulty version, i call them "simple version" and "challenge version", in the challenge version, only accept the solution shorter than the length limit, simple version has no limit, i think it is useful to rank kata's kyu, trainer can easy to select one of them and solve it. ;-)
;-)
Python translation submitted. it's my first translation, so I'm not sure I've done everything correctly, but it seemed functional. :)
thanks, but your random test seems only contains uppercase char, can you fix it?
I think you meant this message for the "Father and Son" kata I translated as well. I fixed the error so it includes both upper and lower case in that kata.
are you also translate for this? I can not see it...
Hmmm. Yes, I translated for this as well. I'm not sure why you can't see it. I just re-published it so maybe you can see it now?
sorry, no... can you give me a url link?
http://www.codewars.com/kumite/56fec84a79989c7355000597?sel=56fec84a79989c7355000597
OK~~