Question
Given the head
of a singly linked list, return true
if it is a palindrome.
https://leetcode.com/problems/palindrome-linked-list/
- Solution1
1 | class Solution { |
Complexity:
Time complexity: O(n)
Space complexity: O(1)
Given the head
of a singly linked list, return true
if it is a palindrome.
https://leetcode.com/problems/palindrome-linked-list/
1 | class Solution { |
Complexity:
Time complexity: O(n)
Space complexity: O(1)
Welcome to my other publishing channels