Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
string match
//Title of this code //g++ 4.8.2 #include <iostream> bool match(const std::string& str1, const std::string& str2, int err, unsigned i = 0, unsigned j = 0) { if (i >= str1.length() || j >= str2.length() || err < 0) return false; if (str1[i] != str2[j]) --err; if (i == str1.length() - 1 && j == str2.length() - 1 && err >= 0) return true; return match(str1, str2, err, i + 1, j + 1) || match(str1, str2, err, i + 1, j) || match(str1, str2, err, i, j + 1); } int main() { std::cout << match("abba", "abba", 1); }
run
|
edit
|
history
|
help
0
Изволов#2
sort
as
static property
LRU - template
IAR compiler bug test code
expm1
void sun()
Karibu
DailyGroceryHisto