Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Longest Common Subsequence

by thundergnat (Deacon)
on May 13, 2006 at 13:33 UTC ( [id://549231]=note: print w/replies, xml ) Need Help??


in reply to Longest Common Subsequence

Why couldn't you do something like this? (There may be some subtle flaw I am missing, but it seems like it should work...)

use strict; use warnings; use Algorithm::Diff qw/LCS/; my @s1 = split //, <DATA>; while (<DATA>) { chomp; next unless length; my @s2 = split //, $_; @s1 = LCS( \@s1, \@s2 ); } print @s1; __DATA__ CPD6Z98SB2KQNWV0F7Y1IX4GLRA5MTOJHE3U CXZOL6SUI2WTJ30HF519YPGBRNAK48MQVD7E T8COSQU6I2FJN40DKL157WVGPYXARZ3MBHE9 KNCWVZDSR5420LP91FIQGB7Y3A6J8MOUXTEH XF9C4PSDY62TWJ0QBN17IKG3OH8ALVRM5UEZ D9QCHUSN7TW2YZL0O831FGXIR6JA4P5MVBKE ZC7ISQUPK6N20OLV4T31G9FRXBAWM5YJHED8 Z3C7SJVODL25TRQ01HPWGNKXB4UA68YMI9EF BC9OXDHS2FI5Z6U0TYL1VPGQK7ANR38MEWJ4 K4TCQBHS2ZV7FXU0P8R1YGDON3A6JILM9EW5

Replies are listed 'Best First'.
Re^2: Longest Common Subsequence
by Limbic~Region (Chancellor) on May 13, 2006 at 14:48 UTC
    thundergnat,
    . o O (because it doesn't produce the correct answer?) 'CS21GAME' ne 'CS201GAME'

    Cheers - L~R

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2024-04-19 22:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found