๋ฌธ์
์ฝ๋
//23:20~00:05
#include <iostream>
using namespace std;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(0);
string s1,s2; cin>>s1>>s2;
int match_cnt = 1e9;
for(int i=0; i<s2.length(); i++){
int temp_cnt = 0;
bool flag = true;
for(int k=0; k<s1.length(); k++){
if(i+s1.length()>s2.length()){
flag = false;
break;
}
if(s2[i+k]!=s1[k]) temp_cnt++;
}
if(flag) match_cnt = min(match_cnt,temp_cnt);
}
cout<<match_cnt;
}
ํ์ด
'Algorithm ๐ง๐ปโ๐ป > ๋ฐฑ์ค(BOJ)' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[๋ฐฑ์ค,c++] 5582๋ฒ - ๊ณตํต ๋ถ๋ถ ๋ฌธ์์ด (0) | 2022.03.25 |
---|---|
[๋ฐฑ์ค,c++] 24499๋ฒ - blobyum (0) | 2022.03.23 |
[๋ฐฑ์ค,c++] 24498๋ฒ - blobnom (0) | 2022.03.23 |
[๋ฐฑ์ค,c++] 11000๋ฒ - ๊ฐ์์ค ๋ฐฐ์ (0) | 2022.03.18 |
[๋ฐฑ์ค,c++] 2504๋ฒ - ๊ดํธ์ ๊ฐ (0) | 2022.03.16 |
[๋ฐฑ์ค,c++] 1748๋ฒ - ์ ์ด์ด ์ฐ๊ธฐ1 (0) | 2022.03.15 |
๋๊ธ