- or download this
sub beautify
{
...
@stuff{@_} = undef;
return sort keys %stuff;
}
- or download this
print join ' ',beautify(qw(h e l l o w o r l d)); # prints "d e h l o
+r w"
print join ' ',beautify(qw(b u m b l e b e e)); # prints "b e l m u"
- or download this
sub beautify
{
...
$stuff{$_}++ for(@_);
return sort { $stuff{$a} <=> $stuff{$b} } keys %stuff;
}
- or download this
print join ' ',beautify(qw(h e l l o w o r l d)); # prints "e w r h d
+o l"
print join ' ',beautify(qw(b u m b l e b e e)); # prints "m u l e b"