#!/usr/bin/perl -w use strict; use warnings; my $count = 0; my $start = time; OUTER: for my $n (1 .. 987_654_321) { my %digits; map { next OUTER if !$_ or $digits{$_}++ or $n % $_ } split //, $n; printf "#%d is %d\n", ++$count, $n; ($count == 548) and printf "Time: %d sec\n", time - $start; }
In reply to Re: Puzzle Time
by golux
in thread Puzzle Time
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |