in reply to Re: Faster (but uglier) PWC 350-2 solutions
in thread Faster (but uglier) PWC 350-2 solutions

I'm responsible for the wording. It definitely has some flaws, but it doesn't allow for the witness to be 1, because of but in different orders.

Digits can be repeated, and such cases do appear in the examples. Namely, in Example 4, we have 2 * 14002857 = 28005714 where the 0 is repeated twice. (Can you find the second occurrence?)

map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

Replies are listed 'Best First'.
Re^3: Faster (but uglier) PWC 350-2 solutions
by LanX (Saint) on Dec 09, 2025 at 16:01 UTC
    > but in different orders.

    My bad, I stand corrected. But writing A < B from the beginning would have been better.

    > Namely, in Example 4,

    does only give the number of occurrences not that explicit result you showed.

    Without calculating the numbers for both interpretations, it's not possible to tell which one is right, if you suspect that the wording is flawed.

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

      > But writing A < B from the beginning would have been better.

      That would need me to think about it more than I did. ;-)

      > Without calculating the numbers for both interpretations, it's not possible

      That's how the Weekly Challenge often works. Sometimes, even the examples don't give enough clues and people come with different interpretations. That's part of the fun.

      map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]