>>247 効率悪いけれど…
Perl

$w='covfefe';
@l=split '',$w;
do {
$_ .= $l[int(rand(7))];
} while (!/$w/);
print index $_, $w . "\n";