Ad
  • Custom User Avatar

    The instruction said [4,4, 3,3..] and that the order doesn't matter, your test check for [3,3,...,4,4] without sorting beforehand...

  • Custom User Avatar

    Given that 0 is a natural number, just saying that it's defined for them would be enough.

  • Custom User Avatar

    A "power set" of a set E is P(E), that is the set of all subsets (part) of E. Why is it called "power set" ? Because you can see it as the set of all functions from E to the boolean set (if True is associated to an element, it is in the subset) which would be noted B^E (if B is the boolean set) and thus has 2^(Card E) elements.

    Of course the interpretation with lists/arrays is to handle those as sets, so you have to forget the ordering of the elements.