Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Divide a list of string into substrings

by LanX (Saint)
on Jun 23, 2020 at 16:50 UTC ( [id://11118384]=note: print w/replies, xml ) Need Help??


in reply to Divide a list of string into substrings

are overlapping substrings allowed?

"333X111", "222X111", "000X333", "000X111"

With overlap "000X","X111","222","333" weight => 22

Otherwise what is the solution???

update

Added first row "333X111"

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery

Replies are listed 'Best First'.
Re^2: Divide a list of string into substrings
by choroba (Cardinal) on Jun 23, 2020 at 18:44 UTC
    > Otherwise what is the solution???

    My program (changing the tolerance to int rand 5) says

    Score 27 $VAR1 = [ [ '333', 'X111' ], [ '222', 'X111' ], [ '000', 'X333' ], [ '000', 'X111' ] ];

    map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (5)
As of 2024-04-19 11:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found