LC234 Panlindrome Linked List
class Solution(object):
def isPalindrome(self, head):
“”"
:type head: ListNode
:rtype: bool
“”"
# second method
if not head or not head.next:
return True
# 1. Get the midpoint (slow)...
原创
2019-09-27 18:46:59 ·
187 阅读 ·
0 评论