in reply to PWC 244 task 2 in linear time

> powers of all possible combinations; power is defined as the square of the largest number in a sequence

My problem with this challenge definition is that a sequence is an ordered set, much like Perl arrays.

But it seems to me the solutions presented are based on unordered subsets.

For clarification:

[2,3,4,5] may be a subset of [0 ..10] and there is only one subset of length 4 possible with 2 minimal and 5 maximal.

But 2 sequences for length 4 °

Am I mistaken and is this a case of TL;DR?

Thanks for clarification.

Cheers Rolf
(addicted to the Perl Programming Language :)
see Wikisyntax for the Monastery

PS: Mohammed's example doesn't help because you need longer arrays to see the difference.

Update

°) And generally n! for length n+2

Replies are listed 'Best First'.
Re^2: PWC 244 task 2 in linear time
by jo37 (Curate) on Nov 28, 2023 at 21:06 UTC

    There is a big charm in the ambiguities in the PWC tasks, IMHO. Don't take the task description too serious. Just find an interpretation of your own. It's fun!

    Greetings,
    -jo

    $gryYup$d0ylprbpriprrYpkJl2xyl~rzg??P~5lp2hyl0p$
      "Interpretation of your own" becomes particular "charming" when np-complete problems are solved in polynomial time. ;)

      Anyway, my question wasn't answered, which problem was solved here?

      Seeing terms of 2**n let's me think it's not for sub sequences.(?)

      Cheers Rolf
      (addicted to the Perl Programming Language :)
      see Wikisyntax for the Monastery