Maurice Tutor

(5)

$15/per page/Negotiable

About Maurice Tutor

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Algebra,Applied Sciences See all
Algebra,Applied Sciences,Biology,Calculus,Chemistry,Economics,English,Essay writing,Geography,Geology,Health & Medical,Physics,Science Hide all
Teaching Since: May 2017
Last Sign in: 398 Weeks Ago, 1 Day Ago
Questions Answered: 66690
Tutorials Posted: 66688

Education

  • MCS,PHD
    Argosy University/ Phoniex University/
    Nov-2005 - Oct-2011

Experience

  • Professor
    Phoniex University
    Oct-2001 - Nov-2016

Category > Computer Science Posted 16 Sep 2017 My Price 7.00

version of Palindrome Game

 

Problem Desciption

Shil likes to play with Palindromes very much.So he created his own version of Palindrome Game. In this game , he will be given
a string S and he needs to find out total number of pairs ( A , B ) such that A and B both are Palindromes present in S and B is a proper suffix of A.
Since string S contains a large number of Palindromes he asks for your help.Note that two Palindromes are considered different if they occurs at different position in string S

Input

Only line of input contains string S

Output

Print a single integer denoting total number of pairs (A,B) . Since answer can be large print it modulus 109+7

Constraints

String S will contain atmost 105 lower case english alphabets ('a' to 'z').

 

Example

Input: aabb Output: 4

Explanation

All the possible palindromes are [ aa , a , a , bb , b ,b ].So all possible pairs are ( aa , a ) , ( aa , a ) , ( bb , b ) , ( bb , b )
Note that two Palindromes are considered different if they occur at different positions in the string S

Answers

(5)
Status NEW Posted 16 Sep 2017 02:09 PM My Price 7.00

Hel-----------lo -----------Sir-----------/Ma-----------dam-----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------and----------- ac-----------qui-----------sit-----------ion----------- of----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n.P-----------lea-----------se -----------pin-----------g m-----------e o-----------n c-----------hat----------- I -----------am -----------onl-----------ine----------- or----------- in-----------box----------- me----------- a -----------mes-----------sag-----------e I----------- wi-----------ll

Not Rated(0)