You are given the head of a singly linked list. Return true if the numbers form a palindrome (the same forward and backward). Otherwise, return false.
Input: head = [3,4,4,3]
Output: true
Explanation:
Forward = 3→4→4→3 and backward = 3→4→4→3.
Input: head = [5,6]
Output: false
Explanation:
Forward = 5→6, backward = 6→5, not the same.
Input: head = [7]
Output: true
Explanation:
A single element is always a palindrome.
Accepted:
Submission: