1) Brute Force # Definition for singly-linked list. # class ListNode: # def __init__(self, val=0, next=None): # self.val = val # self.next = next class Solution: def mergeTwoLists(self, list1: Optional[ListNode], list2: Optional[ListNode]) -> Optional[ListNode]: result = [] a = list1 b = list2 while(a): result.append(a.val) a = a.next while(b): result.append(b.val) b = b.next result.sort() cur =..
Two Sum - LeetCode 1) Brute Forcetime time complexity O(n^2) class Solution: def twoSum(self, nums: List[int], target: int) -> List[int]: for i, num in enumerate(nums): rest = target - num if rest > 0: for j, num in enumerate(nums): if i!=j and num == rest: return [i, j] 2) Hash Map time complexity O(n)
오래된 메일 시스템에 맞추려고 (특히 outlook) div를 사용하지 않고 table 형태로 만든다. cell 사이 간격을 초기화 한 후 (cellspacing cellpading을 0) 스타일링을 시작한다. inline 스타일 이전에 table 속성들을 먼저 활용한다. 메일 스타일은 대부분 정해진 너비 이하로 위아래로 긴 직사각형 스타일이다. 기본 layout은 다음처럼 시작하는 것이 일반적이다. # 추가정보 react를 이용한다면 react email을 통해 쉽게 만들 수 있다. https://react.email/