Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • There are a total of 24 solutions to the puzzle. These 24 solutions are comprised of 10 unique integers. If you do not consider the reverse of an integer unique, there are 5 unique integers. No matter which way you slice this - there is no way to get to "six integers" unless the spec is incomplete.
    • 24 solutions? how did get them? can you show them?
      • Well, first the math

        there is 1 solution for 7, with reverse = 2
        there is 3 solutions for 9, with reverse = 6
        there is 1 solution for 11, with reverse = 2

        2 * 6 * 2 = 24

        I used a bit more complicated code than I am about to show, but you should be able to see how I came up with the 24 solutions

        for my $a (1 .. 9) {
            for my $b (grep {! /$a/} 1 .. 9) {
                for my $c (grep {! /$a|$b/ 1 .. 9) {
                    my $first = join '', $a, $b, $c;
           

        • well, you said: 1 solution for 7, with reverse 2. actually - there are 2 solutions for 7 (4 with reverse).

          and your code shows them.

          also - you didn't take into consideration the fact that digits cannot be reused between numbers generated for various dividers.

          • With regards to the math: What I posted about 24 solutions comprised of 10 different integers was correct (as is my code). I made a mistake when I was explaining where I came up with the 24 solutions because I didn't have the code or the results in front of me. My apologies.

            also - you didn't take into consideration the fact that digits cannot be reused between numbers generated for various dividers

            I am not sure I understand.

            for my $a (1 .. 9) { # 1 - 9
                for my $b (grep {! /$a/} 1 .. 9) { # 1