Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
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?
[GotToBTru]: ah yes that infamous poison di-hydrogen oxide
[Corion]: :-D
[Corion]: Di-hydrogen monoxide is even worse!
choroba needs some CH3CH2OH

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (9)
As of 2016-12-06 12:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (103 votes). Check out past polls.