Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^2: perl array matrix

by perlhelp (Initiate)
on Apr 15, 2015 at 12:43 UTC ( #1123492=note: print w/replies, xml ) Need Help??


in reply to Re: perl array matrix
in thread perl array matrix

How to convert the following concept into the code:

1. Create a mapping from numbers to start positions: Hash of Number to Array of Position.

2. Create a neighbor mapping for all positions: Hash of Position to (Hash of Number to Array of Position) -- or just Hash of Number to Position if you can only have one neighbor with that number.

3. For each search string: initialize position possibilities to the array returned by the start mapping.

Iterate through remaining numbers, getting next position set from the neighbor mapping for the possibilities.

If you have no position possibilities left, it's not a match.

Replies are listed 'Best First'.
Re^3: perl array matrix
by choroba (Archbishop) on Apr 15, 2015 at 20:53 UTC
    I'm sorry I don't understand. Could you please reword, give some examples, draw pictures?
    لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2021-04-17 21:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?