Perl-Sensitive Sunglasses | |
PerlMonks |
Block Searchby artist (Parson) |
on Oct 04, 2002 at 16:14 UTC ( [id://202781]=perlquestion: print w/replies, xml ) | Need Help?? |
artist has asked for the wisdom of the Perl Monks concerning the following question:
Dear Monks I want to find the largest block of similar items in the input. The code I have written is here. This works well if may not be efficient. It finds the first entry of largest block. $string = 'abbbcddddfegrgrgddeeeeedd'; $answer = '------------------eeeee--'I want to do it in a better way, find all the blocks, starting from largest to smallest and want to extend to 2-D and 3-D and may be higher dimensions. This is not from a programming contest or a homework Thanks, Looking for visual solution Artist Edit kudra, 2002-10-04 Removed unclosed pre tag
Back to
Seekers of Perl Wisdom
|
|