Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
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 perusing the Monastery: (11)
As of 2015-01-27 18:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My top resolution in 2015 is:

















    Results (201 votes), past polls