Ad
  • Custom User Avatar

    Thanks for the tip :)

    That's also a good solution to refactor the test code and make it more concise. I'm pretty sure all my kata are open to collaborators so feel free to go ahead and make improvements like this where you see fit.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    Thanks, now any solution containing the proper combinations passes.

    My other comment meant that any of the QC test can be subverted by returning a form of the input data.

  • Custom User Avatar

    From a mathematical point of view, there's exactly one subset of a non-empty set that contains no elements: the emptyset. Therefore, combinations 0 _ = [[]] makes sense: you have exactly one result, and that result is empty (also, the number of returned subsets should be (n!/(k! (n-k)!)), in our case n!/(0!n!) = n!/n! = 1).

  • Custom User Avatar

    My alternative solution, which returns combinations in the opposite order, also passes now. Thanks and I removed the minor issue marker.

  • Default User Avatar

    Thanks!
    I fixed the test to sort before checking.

  • Default User Avatar

    Thanks! I fixed the order issue. I'm not sure I quite understand what you mean about the pathological function though?

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution