Return true if a singly linked list reads the same forwards and backwards. The follow-up asks for O(n) time and O(1) space.
Input: one line of space-separated integers.
Output: true or false.
1 2 2 1
true
1 2
false
Run your code against the sample tests, or Submit to run the full suite.