Computistics
  • 홈
  • 태그
  • 방명록
  • Github
    • 전체 카테고리 (35)
      • Vision AI (7)
        • Classification (2)
        • Object Detection (4)
        • Segmentation (0)
        • etc. (1)
      • Model Compression (6)
      • Pytorch (8)
        • Tutorials (8)
      • Python (14)
        • OpenCV (6)
        • 공부하며적어놓는기록장 (8)
  • 글작성
  • 방명록
  • 환경설정
  • 메뉴 닫기
Sorted 검색 결과
1 개의 검색 결과가 있습니다.
Python/공부하며적어놓는기록장

[LeetCode] 3. 그룹 애너그램

LeetCode 49번 문제는 정렬과 딕셔너리를 활용해서 쉽게 문제풀이가 가능하다. 입력으로 strs = ["eat","tea","tan","ate","nat","bat"]가 주어졌을때 아래와 같이 코딩을 하면 된다. class Solution: def groupAnagrams(self, strs: List[str]) -> List[List[str]]: result = collections.defaultdict(list) for string in strs: result[''.join(sorted(string))].append(string) return list(result.values()) 문제풀이의 핵심은 defaultdict(), sorted(), str.join() 이다. For문을 돌면서 리스트에..

2020. 12. 11. 22:08
  • «
  • 1
  • »

공지사항

전체 카테고리

  • 전체 카테고리 (35)
    • Vision AI (7)
      • Classification (2)
      • Object Detection (4)
      • Segmentation (0)
      • etc. (1)
    • Model Compression (6)
    • Pytorch (8)
      • Tutorials (8)
    • Python (14)
      • OpenCV (6)
      • 공부하며적어놓는기록장 (8)
반응형
  • 최근 글
  • 최근 댓글

최근 글

최근댓글

전체 방문자

오늘
어제
전체

블로그 인기글

Powered by Privatenote/라이프코리아 Copyright © Computistics All rights reserved. TistoryWhaleSkin3.4

티스토리툴바