I am relatively new to this, I'm just looking for some feedback on how wrong my solution is.

What I had in mind was check to see if the next node's value equaled the current node's value, to find the middle. Through this process I stored the value of the nodes into a list, of which I use to determine if it's a palindrome on the second half of the linked list.

Is the idea a potential solution or am I doing it wrong? I provided my (wrong) code below.

```
public boolean isPalindrome(ListNode head) {
if (head == null) return false;
if (head.next == null) return false;
while (head.val != head.next.val) {
list.add(head.val);
if (head.next == null) return false;
head = head.next;
}
head = head.next.next;
for (int i = list.size()-1; i > 0; i--) {
if (list.get(i) != head.val) return false;
else head = head.next;
}
return true;
}
```