Auto-adjust as you go...
#!/usr/bin/perl -l # http://perlmonks.org/?node_id=551038 use strict; use warnings; $_ = 'ABDBACCBBBCBDDBCDCBCCDBABCBABBBBBADACDABACC'; my $n = 0; $n = length $1 while /((.)\2{$n,})/g; print "longest run: $n"
hehehe
In reply to Re: Longest possible run of a single character
by Anonymous Monk
in thread Longest possible run of a single character
by srdst13
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |