
문제 프로그래머스 - 완주하지 못한 선수 코드 def solution(participant, completion): d = {} # 같은 이름이 존재하면 1을 더하고, 존재하지 않으면 0 저장 for x in participant: d[x] = d.get(x, 0) + 1 for x in completion: d[x] -= 1 dnf = [k for k, v in d.items() if v > 0] return dnf[0]

문제 연결 리스트를 뒤집어라. leetcode 206 - Reverse Linked List 코드 # Definition for singly-linked list. # class ListNode: # def __init__(self, val=0, next=None): # self.val = val # self.next = next class Solution: def reverseList(self, head: Optional[ListNode]) -> Optional[ListNode]: node, prev = head, None while node: next, node.next = node.next, prev prev, node = node, next return prev

문제 정렬된 두 개의 링크된 list1과 list2의 head가 주어진다. 두 목록을 하나의 정렬된 list로 병합하고, 병합된 list의 헤드를 반환한다. leetcode 21 - Merge Two Sorted Lists 코드 # 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]: # list1과 list2를 비교하여, ..
- Total
- Today
- Yesterday
- 스프링 부트
- webflux
- 코테
- 릿코드
- 구현
- 노마드코더
- 그리디
- 인프런
- Spring
- 노마드
- mysql 8.0
- 정렬
- leetcode
- 알고리즘
- Real MySQL
- 스프링부트
- 북클럽
- 문자열
- 김영한
- 리팩토링
- MySQL
- 코틀린
- 자료구조
- kotlin
- 백준
- spring boot
- 스프링
- 파이썬
- Algorithm
- 데이터베이스
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |