Ad
  • Custom User Avatar

    Tests are still using Test.assertSimilar in place of where Test.assertDeepEquals is appropriate.

  • Custom User Avatar
  • Custom User Avatar

    The only cases in which you would not be able to produce combinations is that in which arr is null or has a length less than k

    What about k < 0? If you're testing k > arr.length, I don't see why this is not included.

  • Custom User Avatar

    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.