Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^2: Collapsing a string to unique characters

by dwhite20899 (Friar)
on Jan 09, 2009 at 14:17 UTC ( [id://735188]=note: print w/replies, xml ) Need Help??


in reply to Re: Collapsing a string to unique characters
in thread Collapsing a string to unique characters

ikegami,

I tried the lexical order method, and it's almost what I need...

On a mac, I get this output:

FMMNllltuwwxxxz 13AEITfhlllstxx /39CMMNhhlllllluuwwxxx 8ELMMfhllllxxx 49MMdhllllouxx 2239MMlllquxxxx 018AMMPPQTbbffhllllx /2559Mllrtuuwwxz

If I change $seen{$_}++ to $seen{$_}+=2 then I get this:

/034589BDFFHKMMMNNUXabcfghjllllnqsttuuwwwxxxxyzz /112334589AACEEGIIKLMNPQRSTTbdeffhhjkllllnopqssttuxxx //01335899ABCCIMMMNNRTVYbcdefghhhjkllllllloqtuuuwwwxxxxy /035889BEEFKLLMMMNOPQTabcffghhlllllmqrtuvwxxxx +/134456899ACGKMMMNOQWbddghhlllllmnooqrtuuwxxx /2223345899ABDEFGHIMMMNORTabdfhillllnqqtuuwxxxxxyz +/00113457889AACEIMMMNPPPQQTTZabbbcefffghhlllllmqtuwxx //2234555899ACGILMMNOQUbehlllmoqrrsttuuuwwwxxyzz
which DOES list all the chars used, but has duplicates.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://735188]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2026-01-19 09:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your view on AI coding assistants?





    Results (122 votes). Check out past polls.

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.