Example
e.g. i/p is abc , o/p should be abcba
i/p is aaba , o/p should be aabaa.
aaba is not a palindrome
aaaa is a palindorme (so it does not require anything)
aabaa is also a palindrome (so it does not require anything)
Example 1:
-------------
str = abcbad;
revStr = dabcba;
output = abcbadabcba
Example 2:
----------------
str = abcb;
revStr = bcba;
output = abcba;
Ecample 3
str = rrrr
revstr=rrrr
output=rrrr
e.g. i/p is abc , o/p should be abcba
i/p is aaba , o/p should be aabaa.
aaba is not a palindrome
aaaa is a palindorme (so it does not require anything)
aabaa is also a palindrome (so it does not require anything)
Example 1:
-------------
str = abcbad;
revStr = dabcba;
output = abcbadabcba
Example 2:
----------------
str = abcb;
revStr = bcba;
output = abcba;
Ecample 3
str = rrrr
revstr=rrrr
output=rrrr
No comments :
Post a Comment