Is there any reasons return null is tested? Is there any case where this value will be useful? If someone's consuming the combinations the only way this causes visible difference is when using the old-school .next() and manually inspects the value, which almost nobody does compared to standard use cases like for ... of and [...].
Considering the kata is referencing itertools, in Python the return value of a generator is considered to be ignored, unless you try hard, but then this would be very un-Pythonic.
Throwing an exception in case of invalid input makes much more sense.
This comment is hidden because it contains spoiler information about the solution
i did same but like a dum added another statement which is unnecessary
ty!
bery brillinats , thanks
Tests are still using
Test.assertSimilar
in place of whereTest.assertDeepEquals
is appropriate.Duplicate of https://www.codewars.com/kata/54492291ec342c4a440008c5.
What about
k < 0
? If you're testingk > arr.length
, I don't see why this is not included.Is there any reasons
return null
is tested? Is there any case where this value will be useful? If someone's consuming the combinations the only way this causes visible difference is when using the old-school.next()
and manually inspects the value, which almost nobody does compared to standard use cases likefor ... of
and[...]
.Considering the kata is referencing
itertools
, in Python the return value of a generator is considered to be ignored, unless you try hard, but then this would be very un-Pythonic.Throwing an exception in case of invalid input makes much more sense.
This comment is hidden because it contains spoiler information about the solution
This is almost too easy. It works though, nice.
I solved it with using regexp
Not a suggestion.
This comment is hidden because it contains spoiler information about the solution
this problem is painful
This comment is hidden because it contains spoiler information about the solution
Loading more items...