코딩테스트/프로그래머스 - LV 0

[프로그래머스] 부분 문자열

웅드 2024. 1. 30. 16:33

 

 

  • 풀이
#include <string>
#include <vector>

using namespace std;

int solution(string str1, string str2) {
    int answer = 0;
    if(str2.find(str1) != string::npos) return 1;
    return 0;
}
반응형