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

Re: Finding longest palindrome from a string

by Limbic~Region (Chancellor)
on Aug 16, 2004 at 19:38 UTC ( #383423=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    sub LR_Palindrome {
        my $forward = shift;
    ...
        }
        return $palindrome;
    }
    
  2. or download this
    #!/usr/bin/perl
    use strict;
    ...
    edcbabcdefedcbabcde
    abcdedcbabcdefgfedcbabcdefghijklmnonmlkjihgfedcbabcdefghijklkjihgfedcb
    +abcdefghijklmnoponmlkjihgfedcba
    onmlkjihgfedcbabcdefghijklkjihgfedcbabcdefghijklmno
    
  3. or download this
    #!/usr/bin/perl
    use POSIX qw(ceil);
    ...
        return 1 if (substr($input, $left_pos - 1, 1)
                eq substr($input, $right_pos + 1, 1));
    }
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (7)
As of 2014-04-17 11:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (445 votes), past polls