Algorithm Puzzles: Palindrome Linked List
Algorithm Puzzles everyday every week sometimes: Palindrome Linked List
Puzzle
Puzzle from leetcode:
Given the head of a singly linked list, return true if it is a palindrome or false otherwise.
Solution
1 | class Solution { |
T.C.: O(2N)
S.C.: O(N)