- or download this
{M => [0, 2], O => [1]}
- or download this
my @pos;
for my $index (0 .. $#str) {
...
push @{$pos[$index]{$char}}, $offset;
}
}
- or download this
my $sh_str = reduce {length($a) < length($b) ? $a : $b} @str;
- or download this
[2, 1, 1]
- or download this
[[1], [1, 2], [2]]
- or download this
[1, 1, 2]
[1, 2, 2]
- or download this
my (%lookup, @mapping);
CHAR:
...
push @mapping, $ref;
}
}
- or download this
[1, 2, 3] is greater than [0, 0, 1]
[9, 1, 5] is NOT greater than [3, 2, 1] because 1 < 2
- or download this
my %greater;
...
# Return which was greater
return $cmp;
}
- or download this
# A max depth watermark and a path representing that depth
my ($max, $path) = (0, '');
...
# Work queue
# 0 => path, 1 => depth, 2 => last visited leaf
my @work = map [$_, 1, $_], keys %greater;
- or download this
while (@work) {
my $item = pop @work;
...
push @work, map ["$route:$_", $cur_depth + 1, $_], @{$greater{$las
+t_node}[NODE]};
}
- or download this
my $hidden_msg = join '', map $lookup{$_}, split /:/, $path;
return $hidden_msg;