[C++] 프로그래머스 단어 변환


[C++] 프로그래머스 단어 변환

문제 소스 코드 #include <string> #include <vector> #include <queue> #define min(a,b) ((a) >(b) ? (b):(a)) #define pr pair<string,int> using namespace std; int compare(string begin, string word) { int size = min(begin.size(), word.size()); int value = 0; for(int i=0;i<size;i++) { if(begin[i]-word[i] !=0) value++; } if(value > 1) return 0; else return 1; } int solution(string begin, string target, vector<string> words) { int answer =0; queue<pr> q; int level = 0; q.push({begin,level}); while(q.size()>0)...



원문링크 : [C++] 프로그래머스 단어 변환