subject

Write the function longestsubpalindrome(s), that takes a string s and returns the longest palindrome that occurs as consecutive characters (not just letters, but any characters) in s.
so longestsubpalindrome("ab-4-! ") returns "b-4-b".if there is a tie, return the lexicographically larger value -- in python, a string s1 is lexicographically greater than a string s2 if (s1 > s2).
so: longestsubpalindrome("abcbce") returns "cbc", since ("cbc" > "bcb"). note that unlike the previous functions, this function is case-sensitive (so "a" is not treated the same as "a" here).

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 04:30
There is a simple pattern for determining if a binary number is odd. what is it and why does this pattern occur? how many bits would you need if you wanted to have the ability to count up to 1000? how high could you count in binary if you used all 10 of your fingers as bits? (finger up means 1, finger down means 0)
Answers: 3
question
Computers and Technology, 22.06.2019 04:50
Which are steps taken to diagnose a computer problem? a) reproducing the problem and using error codes b) reproducing the problem and troubleshooting c) using error codes and troubleshooting d) using error codes and stepping functions
Answers: 1
question
Computers and Technology, 22.06.2019 06:30
This technology is used to produce high-quality documents that look good on the computer screen and in print. wiki presentation paint desktop publishing
Answers: 3
question
Computers and Technology, 22.06.2019 11:00
When working with a team you should always do the following, except? question 3 options: be dependable and trustworthy be sensitive to others feelings do your fair share critique members of the group
Answers: 2
You know the right answer?
Write the function longestsubpalindrome(s), that takes a string s and returns the longest palindrome...
Questions
question
Mathematics, 19.01.2022 15:50
Questions on the website: 13722363