본문 바로가기

LeetCode4

[ LeetCode ] 819번 Most Common Word leetcode.com/problems/most-common-word/ Most Common Word - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com class Solution: def mostCommonWord(self, paragraph: str, banned: List[str]) -> str: #data cleansing words = [word for word in re.sub('[^\w]',' ',paragraph).lower().split() if .. 2021. 4. 18.
[ LeetCode ] 937번 Reorder Data in Log Files 풀이 leetcode.com/problems/reorder-data-in-log-files/ Reorder Data in Log Files - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com class Solution: def reorderLogFiles(self, logs: List[str]) -> List[str]: letters, digits = [],[] for log in logs: if log.split()[1].isdigit(): digits.append(.. 2021. 4. 16.
[ LeetCode ] 344번 Reverse String leetcode.com/problems/reverse-string/ Reverse String - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com class Solution: def reverseString(self, s: List[str]) -> None: s.reverse() 2021. 4. 15.
[ Leetcode ] 125번 Valid Palindrome 풀이 이 포스팅은 "파이썬 알고리즘 인터뷰" 를 읽고 작성된 포스팅임을 밝힙니다. leetcode.com/problems/valid-palindrome/ Valid Palindrome - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 펠린드롬이란? 앞뒤가 같은 단어나 문장을 말하는 것으로, "수박은 박수" 나 "다시 합창합시다" 와 같은 것을 말한다. 해당 문제는 대소문자를 구분하지 않은 영문자와 숫자를 대상으로 펠린드롬인지 아닌지에 대한 여부를 판단하는 문제이다. .. 2021. 4. 15.