Problem Solving/LeetCode(27)
-
[LeetCode] 937. Reorder Data in Log Files
https://leetcode.com/problems/reverse-string/submissions/ 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 reorderLogFiles(self, logs: List[str]) -> List[str]: char_log: str = [] int_log: str = [] # 문자, 숫자로그 판별 for s in logs: if s.split()[1]..
2021.01.04 -
[LeetCode] 344. Reverse String
https://leetcode.com/problems/reverse-string/submissions/ 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: i = len(s) // 2 while i > 0: s[i-1], s[len(s)-i] = s[len(s)-i], s[i-1] i -= 1 "리턴 없이 리스트 내부..
2021.01.04 -
[LeetCode] 125. Valid Palindrome
https://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 팰린드롭 이란? 앞뒤가 똑같은 단어나 문장. 뒤집어도 같은 말이 된다. 우리말로는 '회문'이라고 한다. 내 풀이 class Solution: def isPalindrome(self, s: str) -> bool: strs = [] # 소문자로 변환 for i in s: if i.isalnum(): ..
2021.01.04