일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- 30. Substring with Concatenation of All Words
- iterator
- 315. Count of Smaller Numbers After Self
- 운영체제
- 시바견
- Python Implementation
- t1
- attribute
- Regular Expression
- 715. Range Module
- Substring with Concatenation of All Words
- Convert Sorted List to Binary Search Tree
- 43. Multiply Strings
- LeetCode
- concurrency
- Protocol
- 109. Convert Sorted List to Binary Search Tree
- 프로그래머스
- DWG
- kaggle
- 컴퓨터의 구조
- Decorator
- 밴픽
- Python
- shiba
- Python Code
- Generator
- data science
- 파이썬
- Class
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