https://leetcode.com/problems/palindrome-linked-list/
# 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: Optional[ListNode]) -> bool:
arr = []
while(1):
arr.append(head.val)
if not head.next: break
head = head.next
print(arr)
return arr == arr[::-1]
링크드 리스트를 배열형식으로 변환 후 비교해주었다