Would this work on foreign computers as well? Computers that aren't set to English or another western writing system might not respond in a way that solves the exercise because their language might not have upper and lower case. So I'm not sure about this being best practice.
To be fair They should've written that in capslocks... I was right about to close the tab when I've came here and read your comment :)))
Thanks for saving some of my time :')
Nearly tore my hair out, because all but one test was passing, before realising i had my two checks for null or empty the wrong way around and that was causing the error! Had never seen that error message before so didn't know what it meant and took awhile and about twenty attempts at fixing other things to work it out! Good kata...bad human...
HA! was gonna complain on failing to recieve instructions, Until i now re-read the instructions and saw that "if given empty array or null, return a empty array"
This is a great exercise to learn to read the instructions and make sure to understand what it is you are supposed to do. i failed to take the time to comprehend and suffered the consequences for my own failings, which is the essence of programming.
Good one mate :)
Check if this fork is fine, increased the number of random tests from 40 to 100, changed the maximum length of the arrays from 100 to 10 and the minimum from 1 to 0.
Yes, but the lack of such tests thus lead to the reference solution being wrong, and has not been discovered until now, so IMO there is nothing wrong with random test coverage on all input ranges
Python (at least): random tests do not generate empty arrays, OTOH, the reference solution is wrong because it returns [0, 0] instead of [] for empty arrays ...
pretty smart actually.
Would this work on foreign computers as well? Computers that aren't set to English or another western writing system might not respond in a way that solves the exercise because their language might not have upper and lower case. So I'm not sure about this being best practice.
To be fair They should've written that in capslocks... I was right about to close the tab when I've came here and read your comment :)))
Thanks for saving some of my time :')
Because array indices start from 0.
Nearly tore my hair out, because all but one test was passing, before realising i had my two checks for null or empty the wrong way around and that was causing the error! Had never seen that error message before so didn't know what it meant and took awhile and about twenty attempts at fixing other things to work it out! Good kata...bad human...
HA! was gonna complain on failing to recieve instructions, Until i now re-read the instructions and saw that "if given empty array or null, return a empty array"
This is a great exercise to learn to read the instructions and make sure to understand what it is you are supposed to do. i failed to take the time to comprehend and suffered the consequences for my own failings, which is the essence of programming.
Good one mate :)
@ejini战神 check the fork, approve if you like.
Sorry, but I don't know what you're talking about:
And that's what your current code is doing.
problematic task. spent a lot of time because of the crooked return of an empty array in the form (0,0)
Enjoyed the kata but definitely too much for an 8 kyu-
Check if this fork is fine, increased the number of random tests from 40 to 100, changed the maximum length of the arrays from 100 to 10 and the minimum from 1 to 0.
https://www.codewars.com/kumite/67a0bafdf2dcbc48ddd867dd?sel=67a0bafdf2dcbc48ddd867dd
Oh now I see that was my problem then thanks for reply.
Yes, but the lack of such tests thus lead to the reference solution being wrong, and has not been discovered until now, so IMO there is nothing wrong with random test coverage on all input ranges
But there is already a fixed test that covers that case. Why do you say it's necessary to cover it also in random tests?
Python (at least): random tests do not generate empty arrays, OTOH, the reference solution is wrong because it returns
[0, 0]
instead of[]
for empty arrays ...Loading more items...