일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 31 |
Tags
- Substring with Concatenation of All Words
- attribute
- data science
- Regular Expression
- 715. Range Module
- Generator
- Protocol
- Python Implementation
- 파이썬
- LeetCode
- 43. Multiply Strings
- Python Code
- shiba
- t1
- 컴퓨터의 구조
- 밴픽
- 315. Count of Smaller Numbers After Self
- DWG
- Python
- Decorator
- 시바견
- 프로그래머스
- 30. Substring with Concatenation of All Words
- 운영체제
- iterator
- Class
- 109. Convert Sorted List to Binary Search Tree
- concurrency
- Convert Sorted List to Binary Search Tree
- kaggle
Archives
- Today
- Total
목록234. Palindrome Linked List (1)
Scribbling
LeetCode: 234. Palindrome Linked List
Solution for Q.234 within O(N) time complexity and O(1) memory. To check whether it's a palindrome, we have to check two elements simultaneously from the head and tail. But in singly linked list, we have no way to check the elements in reverse order from the tail. So, the solution is simple. Reverse the second half of the list and compare two lists. Below is the code. # Definition for singly-lin..
Computer Science/Coding Test
2021. 12. 24. 12:40