# Definition for singly-linked list.
# class ListNode:
# def __init__(self, val=0, next=None):
# self.val = val
# self.next = next
class Solution:
def isPalindrome(self, head: ListNode) -> bool:
lis=[]
temp=head
while temp:
lis.append(temp.val)
temp=temp.next
def isPalindrome(s):
return s == s[::-1]
s =""
for i in lis:
s=s+str(i)
if isPalindrome(s):
return True
else:
return False