Tag: LeetCode: 234 Palindrome Linked List
-
LeetCode: 234 Palindrome Linked List
•
Given the head of a singly linked list, return true if it is a palindrome. Example Input: head = [1,2,2,1] Output: true Input: head = [1,2] Output: false 问题 给定单链表的头节点 head,如果它是回文链表,则返回 true。 例子 输入: head = [1,2,2,1] 输出: true 输入: head = [1,2] 输出: false Solution Approach: Two Pointers (Fast…