From 9a88c4b573124395c76fe0ad39d69aab706263b7 Mon Sep 17 00:00:00 2001 From: yubin Date: Mon, 27 May 2024 22:43:45 +0900 Subject: [PATCH] 48-xxubin04 --- xxubin04/README.md | 6 +++++- .../125_Valid Palindrome.py" | 12 ++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 "xxubin04/\352\265\254\355\230\204/125_Valid Palindrome.py" diff --git a/xxubin04/README.md b/xxubin04/README.md index 721ab37..34d616f 100644 --- a/xxubin04/README.md +++ b/xxubin04/README.md @@ -45,4 +45,8 @@ | 41차시 | 2024.04.08 | Math | [1484]다이어트 | https://github.com/AlgoLeadMe/AlgoLeadMe-3/pull/157 | | 42차시 | 2024.04.29 | 구현 | [66]Plus One | https://github.com/AlgoLeadMe/AlgoLeadMe-3/pull/158 | | 43차시 | 2024.05.02 | Math | [16943]숫자 재배치 | https://github.com/AlgoLeadMe/AlgoLeadMe-3/pull/161 | -| 44차시 | 2024.05.06 | Math | [6603]로또 | https://github.com/AlgoLeadMe/AlgoLeadMe-3/pull/163 | +| 44차시 | 2024.05.06 | BackTracking | [6603]로또 | https://github.com/AlgoLeadMe/AlgoLeadMe-3/pull/163 | +| 45차시 | 2024.05.14 | Math | [8989]시계 | https://github.com/AlgoLeadMe/AlgoLeadMe-3/pull/170 | +| 46차시 | 2024.05.16 | Binary Search | [16401]과자 나눠주기 | https://github.com/AlgoLeadMe/AlgoLeadMe-3/pull/173 | +| 47차시 | 2024.05.23 | Math | [14241]슬라임 합치기 | https://github.com/AlgoLeadMe/AlgoLeadMe-3/pull/178 | +| 48차시 | 2024.05.27 | 구현 | [125]Valid Palindrome | https://github.com/AlgoLeadMe/AlgoLeadMe-3/pull/182 | diff --git "a/xxubin04/\352\265\254\355\230\204/125_Valid Palindrome.py" "b/xxubin04/\352\265\254\355\230\204/125_Valid Palindrome.py" new file mode 100644 index 0000000..802d421 --- /dev/null +++ "b/xxubin04/\352\265\254\355\230\204/125_Valid Palindrome.py" @@ -0,0 +1,12 @@ +from collections import deque + +class Solution(object): + def isPalindrome(self, s): + ans = deque() + s_list = list(s) + for i in s_list: + if i.isalnum(): + ans.append(i.lower()) + if ''.join(ans) == ''.join(reversed(ans)): + return True + return False \ No newline at end of file