Jeongeun's LAB

  • 홈
  • 태그
  • 방명록

BFS 1

[ 알고리즘 ] BFS 문제 - 단어 변환

문제) 두 개의 단어 begin, target과 단어의 집합 words가 있습니다. 아래와 같은 규칙을 이용하여 begin에서 target으로 변환하는 가장 짧은 변환 과정을 찾으려고 합니다. 1. 한 번에 한 개의 알파벳만 바꿀 수 있습니다. 2. words에 있는 단어로만 변환할 수 있습니다. 예를 들어 begin이 "hit", target가 "cog", words가 ["hot","dot","dog","lot","log","cog"]라면 "hit" -> "hot" -> "dot" -> "dog" -> "cog"와 같이 4단계를 거쳐 변환할 수 있습니다. 두 개의 단어 begin, target과 단어의 집합 words가 매개변수로 주어질 때, 최소 몇 단계의 과정을 거쳐 begin을 target으로 변..

Algorithm 2024.04.12
이전
1
다음
더보기
  • 분류 전체보기 (62)
    • OS (17)
    • Network (19)
    • Algorithm (9)
    • Open source (7)
    • Docker (2)
    • Kubernetes (6)
    • Internship (1)
    • AWS (1)

최근글과 인기글

  • 최근글
  • 인기글

Tag

dnf-automatic, epel-release, logging system, openlab, journald, systemd, journalctl, controller-runtime, k8s, 오픈랩, aws summit seoul 2024, 티스토리챌린지, 데보션오픈랩, systemtl, 쿠버네티스 구성요소, kubebuilder, borg, #k3s, 오블완, fhs,

방문자수Total

  • Today :
  • Yesterday :

Copyright © Kakao Corp. All rights reserved.

티스토리툴바