- or download this
my $given = $ARGV[0];
# ...
...
}
return 1;
}
- or download this
my $input = $ARGV[0];
$input = str2val($input);
...
my ($word, $val) = split /\t/;
print "$word\n" if $is_subset{$input - $val};
}
- or download this
a = 1
b = (a * max) + 1
c = (b * max) + 1
...
z = (y * max) + 1
- or download this
sub str2val {
my ($str) = @_;
...
}
return $str;
}
- or download this
my $input = $ARGV[0];
my %is_subset = map {$_ => 1} powerset(split //, $input);
...
# ...
return map {join '', sort @$_} @subsets;
}