일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- Substring with Concatenation of All Words
- 컴퓨터의 구조
- concurrency
- t1
- 시바견
- attribute
- shiba
- Convert Sorted List to Binary Search Tree
- 밴픽
- 109. Convert Sorted List to Binary Search Tree
- LeetCode
- Decorator
- Class
- Protocol
- Generator
- Regular Expression
- iterator
- 운영체제
- 30. Substring with Concatenation of All Words
- 715. Range Module
- kaggle
- 315. Count of Smaller Numbers After Self
- Python
- Python Implementation
- 파이썬
- 프로그래머스
- Python Code
- 43. Multiply Strings
- data science
Archives
- Today
- Total
목록49. Group Anagrams (1)
Scribbling
LeetCode: 49. Group Anagrams
class Solution: def groupAnagrams(self, strs: List[str]) -> List[List[str]]: from collections import defaultdict dic = defaultdict(list) for s in strs: counter = [0] * 26 for char in s: counter[ord(char) - ord('a')] += 1 dic[tuple(counter)].append(s) return [x for x in dic.values()]
Computer Science/Coding Test
2021. 9. 8. 17:01