
https://leetcode.com/problems/subtree-of-another-tree/ Subtree of Another Tree - 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 subRoot 노드가 root 노드의 subtree인지 확인하는 문제입니다. 노드의 val, left, right가 같은지 확인하면서 들어가야해서 두개의 재귀함수가 필요했습니다. None처리가 굉장히 복잡했던 문제.. dfs함수는 root함수를 dfs로 탐색하고, comp..

https://leetcode.com/problems/sort-integers-by-the-number-of-1-bits/ Sort Integers by The Number of 1 Bits - 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 int 형태의 숫자를 bit로 만들었을경우 1과 0으로 표현할 수 있다. ex) 7 -> 01 이때 나오는 1의 갯수로 int리스트를 정렬해주면 된다. 나는 countOneBit라는 함수를 만들어서 했지만 python에는 >..

https://www.acmicpc.net/problem/1339 1339번: 단어 수학 첫째 줄에 단어의 개수 N(1 ≤ N ≤ 10)이 주어진다. 둘째 줄부터 N개의 줄에 단어가 한 줄에 하나씩 주어진다. 단어는 알파벳 대문자로만 이루어져있다. 모든 단어에 포함되어 있는 알파벳은 최대 www.acmicpc.net ABC, BACDE가 있다면 B가 제일 높은숫자, 그다음 A, C 순으로 큰 자릿수에 있는 알파벳 순으로 높은 숫자를 매겨줘야 제일 큰 합을 얻어낼 수 있습니다. 이를 위해 1의자리에 있는 알파벳 (C, E) 에 1을 더해주고, 10의자리에 있는 알파벳(B, D)에는 10을 더해주고 마지막에 정렬을 해줘서 제일 숫자가 높은 알파벳에 우선순위를 정할 수 있도록 하였습니다. # https://w..

https://leetcode.com/problems/merge-two-sorted-lists/ Merge Two Sorted Lists - 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 두개의 연결리스트를 하나로 합치는 문제 입니다. 이미 정렬이 되어있는 리스트 이기 때문에 두 연결리스트의 노드를 순회 하면서 둘중 더 작은 노드를 node.next 로 지정해서 나아가면 됩니다. get_next는 다음 노드를 정하는 함수 입니다. go_next는 노드 여부에 따..
- Total
- Today
- Yesterday
- django
- gunicorn
- 독후감
- for-else
- ManyToMany
- stdout
- 팰린드롬수
- 프로그래머스
- conTeXt
- dfs
- 문자열 뒤집기
- Python
- query
- taggit
- go context
- 소프트웨어 장인
- 파이썬
- Two Scoops of Django
- 의대 신경학 강의
- 방금그곡
- go
- 백준
- sql lite
- leetcode
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |