LeetCode daily problem 234. Palindrome Linked List, simple enough, traversed the linked list while adding the node's value into an array, then compared it to a version going backwards. I believe the time & space complexity are O(n) linear. Did you give it a try? Link to my solution.

https://github.com/cardosopab/LeetCodeNotes/blob/main/2024/03/234.py

#python
#pythonprogramming
#algorithms
#datastructures

LeetCodeNotes/2024/03/234.py at main · cardosopab/LeetCodeNotes

Culmination of daily LeetCode problems. Contribute to cardosopab/LeetCodeNotes development by creating an account on GitHub.

GitHub