summaryrefslogtreecommitdiff
path: root/perl/p4.pl
blob: 9982fa54ef7bd82b7711cba556b047b317a221f9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/env perl

use strict;
use warnings;

use List::Util qw(max);

# Functional

# Imperative
my $resp;
for my $x (100 .. 999) {
	for my $y ($x .. 999) {
		my $cand = $x*$y;
		$resp = max($resp, $cand) if $cand eq reverse($cand);
	}
}
print "$resp\n";