일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 31 |
Tags
- DWG
- Python Implementation
- t1
- data science
- 운영체제
- Python Code
- attribute
- concurrency
- 시바견
- 109. Convert Sorted List to Binary Search Tree
- 30. Substring with Concatenation of All Words
- 밴픽
- 컴퓨터의 구조
- 715. Range Module
- iterator
- Regular Expression
- Class
- Python
- LeetCode
- Convert Sorted List to Binary Search Tree
- 43. Multiply Strings
- 프로그래머스
- 315. Count of Smaller Numbers After Self
- Generator
- kaggle
- shiba
- Decorator
- Protocol
- Substring with Concatenation of All Words
- 파이썬
Archives
- Today
- Total
목록Word Ladder II (1)
Scribbling
LeetCode: 126. Word Ladder II
개인적으로 어려웠던 문제... A. 내가 푼 방법 일단 내가 푼 방법은 아래와 같다. 1) 모든 word에 대해 graph를 그린다. (word간 글자가 1개만 차이나는 경우 연결) 2) 다익스트라 알고리즘으로 최단 경로를 찾는다. 나름 머리 써서 푼건데, 속도도 느리고 메모리 효율도 떨어져서 실망스럽다. import heapq class Solution: def findLadders(self, beginWord: str, endWord: str, wordList: List[str]) -> List[List[str]]: if endWord not in wordList: return [] if beginWord not in wordList: wordList.append(beginWord) s_idx = w..
Computer Science/Coding Test
2021. 10. 6. 21:43