문제 링크:https://leetcode.com/problems/valid-palindrome/description/?envType=study-plan-v2&envId=top-interview-150Palindrome 에 관한 문제이다. 문제만 잘 읽는다면 문제 없이 풀 수 있다.사실 leetcode를 풀 때 초반 장벽은 아마 영어 단어이지 않을까 싶다. 다행히 이 문제에서는 palindrome이 어떤 특징을 가진 단어인지 설명을 해주는데, 코테 문제에서는 설명을 안해주는 경우도 허다해서 난감했던 기억이 있다. [내 풀이]class Solution: def isPalindrome(self, s: str) -> bool: if len(s) == 0: return Tru..
two pointer
문제 링크: https://neetcode.io/problems/buy-and-sell-crypto NeetCode neetcode.io 투 포인터/슬라이딩 윈도우 [내 풀이]class Solution: def maxProfit(self, prices: List[int]) -> int: maxProfit = 0 for i in range(len(prices)-1): for j in range(i, len(prices)): profit = prices[j] - prices[i] if profit > maxProfit: maxProfit = profit ret..