집 근처 새로운 카페가 생겨서 바로 가봄 이탈리안 에스프레소를 베이스로 하는 카페라고 함 (방문당시) 오픈한 지 이제 막 일주일 된 따끈따끈한 카페☕️ 처음엔 간판이 없어서 읭 했는데 저렇게 입간판으로 해놓으니 더 트렌디 해 보이는 거 같다. 내부는 그렇게 넓진 않지만 깔끔하고 조용히 담소 즐길 수 있는 분위기였다. (메뉴판이 갬성에 한 몫함ㅎ) 에스프레소 바라 그런지 에스프레소 메뉴만 저렇게 많아요! 주류도 판매함 가격이 매우 합리적이라 일단 합격 :) 에스프레소를 즐겨 마시진 않지만 그래도 이런 데 왔으면 한잔 마셔줘야 하니까 바로 주문 잔이 너무 귀여움ㅠㅠㅠ 전용 잔들은 이탈리안 대리석을 컨셉으로 직접 주문 제작해서 도자기로 빚은 거란다. 사장님이 컨셉에 진심이심ㅋㅋㅋㅋ 예전에 경험했던 에스프레소는..
문제 : https://leetcode.com/problems/letter-combinations-of-a-phone-number/ 난이도 : Medium 풀이 class Solution: def letterCombinations(self, digits: str) -> List[str]: dict = {'2':"abc", '3':"def", '4':"ghi", '5':"jkl", '6':"mno", '7': "pqrs", '8':"tuv", '9':"wxyz"} comb = [''] if digits else [] for d in digits: comb = [p + q for p in comb for q in dict[d]] return comb
문제 : https://leetcode.com/problems/container-with-most-water/ 난이도 : Medium 풀이 class Solution: def maxArea(self, height: List[int]) -> int: l, r = 0, len(height) - 1 water = 0 while l < r: water = max(water, (r - l) * min(height[l], height[r])) # 저장할 수 있는 최대 물 if height[l] < height[r]: l += 1 else: r -= 1 return water 대학생 때 풀었던 거 같은데.. 오랜만에 보는 문제ㅎㅎ 왼쪽에서 움직이는 포인터(l)와 오른쪽에서 움직이는 포인터(r)를 두고 저장할 수 있는..
문제 : https://leetcode.com/problems/contains-duplicate-ii/description/ 난이도 : Easy 풀이 class Solution: def containsNearbyDuplicate(self, nums: List[int], k: int) -> bool: nDict = {} for i, n in enumerate(nums): if n in nDict and abs(i - nDict[n])
문제 : https://leetcode.com/problems/isomorphic-strings/description/ 난이도 : Easy 풀이 class Solution: def isIsomorphic(self, s: str, t: str) -> bool: sDict = [] tDict = [] for idx in s: sDict.append(s.index(idx)) for idx in t: tDict.append(t.index(idx)) if sDict == tDict: return True return False 처음 나타내는 문자의 인덱스를 찾아주는 index 함수를 사용해서 각 단어들의 인덱스를 저장해준다. 그리고 그 인덱스 사전들끼리 비교해주면 된다!