시나위

  • 홈
  • 태그
  • 방명록

단어변환 1

[프로그래머스] LEVEL3 단어 변환, python3, 깊이/너비 우선 탐색(DFS/BFS)

def solution(begin, target, words): if not target in words: return 0 answer = 0 queue = [begin] while words!=[]: answer+=1 tmp=[] while queue: word_stack=queue.pop(0) for word in words: change=0 for i in range(len(word)): if word[i]==word_stack[i]: change+=1 if change==len(word)-1: tmp.append(word) words= list([word for word in words if word not in tmp]) #print("after:",tmp,words) if tmp==[] and..

STUDY/Algorithm 2020.01.17
이전
1
다음
더보기
프로필사진

하고 싶은 거 다하고 정리하는 블로그

  • 분류 전체보기 (669)
    • STUDY (529)
      • Algorithm (402)
      • C, C++ (7)
      • Python (33)
      • Rust (28)
      • Swift & iOS (16)
      • Web (10)
      • Raspberry Pi (10)
      • Others (23)
    • OTHERS (140)
      • 내 생각 (134)
      • 리뷰 (5)

Tag

구현, dp, BOJ, 다익스트라, 프로그래머스, python3, dfs, 혼공단, 파이썬, 브루트포스, python, baekjoon, C, 그래프탐색, 시뮬레이션, 백준, 백트래킹, BFS, C++, 혼공파,

최근글과 인기글

  • 최근글
  • 인기글

최근댓글

공지사항

페이스북 트위터 플러그인

  • Facebook
  • Twitter

Archives

Calendar

«   2025/05   »
일 월 화 수 목 금 토
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

방문자수Total

  • Today :
  • Yesterday :

Copyright © Kakao Corp. All rights reserved.

티스토리툴바