题目描述
Given a linked list of strings having n nodes check to see whether the combined string formed is palindrome or not.
Input:
You have to complete the method which takes one argument: the head of the linked list . You should not read any input from stdin/console.. There are multiple test cases. For each test case, this method will be called individually.
Output:
Your function should return True if the combined string is pallindrome else it should return False.
User Task:
The task is to complete the function compute() which returns true or false.
Constraints:
1 <=T<= 10^{3}
1 <=n<= 10^{3}
Example:
Input :
2
5
a bc d dcb a
4
a bc d ba
Output :
True
False
Explanation:
case 1 : as String "abcddcba" is palindrome the function should return true
case 2 : as String "abcdba" is not palindrome the function should return false
输入格式
见题面
输出格式
见题面