Notice
Recent Posts
Recent Comments
Link
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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
- DeepLearning
- 백준
- pep8
- rnn
- python
- FastAPI
- 네이버AItech
- Matplotlib
- PytorchLightning
- pytorch
- FDS
- autoencoder
- wandb
- GIT
- vscode
- NaverAItech
- docker
- leetcode
- 완전탐색
- NLP
- 코딩테스트
- torchserve
- GCP
- 프로그래머스
- datascience
- github
- GitHub Action
- 알고리즘
- Kubernetes
- Kaggle
Archives
- Today
- Total
Sangmun
Palindrome 본문
https://www.youtube.com/watch?v=Yjgmw3rMof4&t=3s
https://leetcode.com/problems/valid-palindrome/
Valid Palindrome - LeetCode
Can you solve this real interview question? Valid Palindrome - A phrase is a palindrome if, after converting all uppercase letters into lowercase letters and removing all non-alphanumeric characters, it reads the same forward and backward. Alphanumeric cha
leetcode.com
class Solution:
def isPalindrome(self, s: str) -> bool:
tmp = ''
for each in s:
if each.isalnum():
tmp += each.lower()
if tmp == tmp[::-1]:
return True
else:
return False'알고리즘 > 리트코드' 카테고리의 다른 글
| 459. Repeated Substring Pattern (0) | 2023.08.12 |
|---|---|
| 283. Move Zeroes (0) | 2023.05.04 |
| 516. Longest Palindromic Subsequence (0) | 2023.04.22 |
| 662. Maximum Width of Binary Tree (0) | 2023.04.20 |
| Leet code Validate Stack Sequences (0) | 2023.04.13 |
Comments