简单
class Solution:
def isPalindrome(self, head: ListNode) -> bool:
lst = list()
cur = head
while cur:
lst.append(cur.val)
cur = cur.next
for i in range(len(lst)//2):
if lst[i] == lst[len(lst) - i - 1]:
i += 1
else:
return False
return True