단어 변환

    [3] 단어 변환

    #include #include #include #include using namespace std; #define MAX 50 vector vWord; string targ = ""; bool vis[MAX + 1]; int ans = INT_MAX; void DFS(string begin, int depth) { if (targ == begin) { ans = min(ans, depth); return; } for (int i = 0; i < vWord.size(); i++) { int cnt = 0; for (int j = 0; j < vWord[i].size(); j++) { if (begin[j] != vWord[i][j]) cnt++; if (cnt == 2) break; } if (cnt =..