7 kyu
Not above the one!
861 of 1,512Nspringham
Loading description...
Arrays
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.
This comment has been hidden.
Read how you use
append
and mark your post as having spoiler content next time.python translation:
https://www.codewars.com/kumite/5e92ea8050beae002f3404e0?sel=5e92ea8050beae002f3404e0
Simple, yet nice to relax a bit. Thank you
Haskell translation
.
It seems to be just yet another array filtering kata.
Did you not enjoy it then?
This comment has been hidden.
Is it just that one test case that was wrong?
This comment has been hidden.
would you mind posting your code so i can see for myself?
My code won't affect what your tests are expecting
This comment has been hidden.
I'm honestly not sure why they are showing up like that.. i have made a minor change to the tests, if you could try it again for me!
It's strange that the tests have only shown like that for you, no one else :/
Same problem. Could you try changing your test to use test.assertSimilar instead of test.AssertDeepEquals ?
Not sure if it will help - the example tests use deepEquals too and I pass them. Weird. Have checked your test cases and can't find a reason either.
i've changed the tests to test.assertSimilar, see if that works :)
Afraid not
I may be wrong here, but i was interested by what was happening here that i started to look at it(Dont know much Java myself.) but the only thing i can see is that maybe it is because in your code you modify the original array. I believe this change to the array makes just the 1's and 0's remain in the array when it is sent to the test function so there is nothing for it to remove and it give the expected answer of just 1's an 0's and nothing removed. Hope this makes sense.
Pass a copy of the array to the user's function or get the expected answer first. You're allowing the user to mutate the input so your testing code produces wrong expected values. In the random tests, you're not using
a
at all, you can remove it.