전체 글

카테고리 없음

21. Merge Two Sorted Lists

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 =..

CODE/잡기술

Two Sum

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)

CODE/잡기술

HTML Email Template 만들기

오래된 메일 시스템에 맞추려고 (특히 outlook) div를 사용하지 않고 table 형태로 만든다. cell 사이 간격을 초기화 한 후 (cellspacing cellpading을 0) 스타일링을 시작한다. inline 스타일 이전에 table 속성들을 먼저 활용한다. 메일 스타일은 대부분 정해진 너비 이하로 위아래로 긴 직사각형 스타일이다. 기본 layout은 다음처럼 시작하는 것이 일반적이다. # 추가정보 react를 이용한다면 react email을 통해 쉽게 만들 수 있다. https://react.email/

CODE/잡기술

티스토리 다크모드에서 글자가 안 보일 때

티스토리 다크모드에서 검정 글씨가 흰색으로 바뀌지 않는 버그가 있다. 글쓰기 > 오른 쪽 위에 기본모드 > HTML 모드로 변경 span tag에 inline style이 적용되서 생기는 버그이므로 span을 통으로 지워준다. 티스토리 다크모드 이상하다

기루다
하늘과 바람과 별과 시