# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1141971 | walaelaa13 | Mutating DNA (IOI21_dna) | C++20 | 0 ms | 0 KiB |
#include "dna.h"
#include <bits/stdc++.h>
using namespace std;
string a,b;
void init(std::string A, std::string B) {
a=A;
b=B;
}
int get_distance(int x, int y) {
string suba= a.substr(x, y);
string subb= b.substr(x, y);
int A=count(suba.begin(), suba.end(), A);
int B=count(subb.begin(), subb.end(), A);
if(A!=B) return -1;
int sol=0;
for(int i=0;i<y-x;i++){
if(sub[i]!=subb[i]){
sol++;
}
}
return sol;
}