Question: 1 . Palindromes in a String You are given a string, str . You need to find the score of stras per the following rules:
Palindromes in a String You are given a string, str You need to find the score of stras per the following rules: For each palindrome of length in str add to the score For each palindrome of length in str add to the score It is given that palindromes can.overlap within str However, the characters of the palindrome must be continuous and must NOT be circular ie they must NOT wrap around the end of the string Output the final value of score. Notes: A palindrome is a word, phrase, or sequence that reads the same backwards as forwards. Examples of palindromes are words like "madam", "racecar", "abCba" and "aBccBa", and "ABBA" Palindromes are casesensitive in this problem eg "Madam" and "ABCcba" are NOT palindromes The score is initially There are no whitespaces in str Answered str Function description Complete the scoreString function in the editor below. It has the following parameters: Name Type STRING Description The string you are given
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
