📌 리턴할 때 문자열도 리턴 가능하다. 하지만 문자열+숫자 조합은 불가능하기 때문에 숫자 i 를 to_string()
문자열로 변환하여 리턴함 (문자열에는 숫자 그대로 집어넣을 수 없기 때문)
서울에서 김서방 찾기.cpp
#include <string>
#include <vector>
using namespace std;
string solution(vector<string> seoul) {
for(int i = 0; i < seoul.size(); i++) {
if(seoul[i] == "Kim")
return "김서방은 " + to_string(i) + "에 있다";
}
}