Hamming Distance

You are given an array A of length N. At first, all the elements of array A will be 0. You are given…

Click here to read the complete problem statement.


If you need help solving this problem, mention your approach and ask specific questions. Please avoid sharing your code and asking the Community to figure out “what’s wrong”.

#include<bits/stdc++.h>
using namespace std;

int main()
{
int n,m,sum=0,c=0,j=0,k=0;
cin >> n >> m;int l=m;
char s[n],ss[m];
cin >> s >> ss;
while(m<=n)
{
for(int i=j,k=0;i<m,k<l;i++,k++)
{
if(s[i]!=ss[k])c++;
}
sum+=c;
j++;m++;c=0;
}
cout<<sum<<endl;
sum=0;c=0;
}

///What is problem?