For this Question: Given two strings S1 and S2 you have to make the two strings equal. 
To make them equal you can change any character of S1 or S2 to any other lowercase letter. 
You can perform this operation at most X number of times. 
Find the number of ways to make S1 and S2 equal. Two ways are considered different if the string formed after changes are different in both cases. 
As the number of ways can be large compute number of ways modulo 1000000007.First line of input contains S1 
Second line of input contains S2
Third line of input contains X.

Constraints
1 <= |S1| <= 100000
|S1| = |S2|
0 <= K <= |S1| +|S2|Output a single integer, the required value modulo 1000000007.Sample input 1
nlbmb
wrbqh
4

Sample output 1
16

Sample input 2
xpc
qve
1

Sample output 2
0, I have written this Solution Code: #include <bits/stdc++.h>
using namespace std;
 
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define ll long long
#define int long long

const int N = 1e5 + 5;
const int MOD = 1e9 + 7;

int pow(int a, int b, int m)
{
	int ans=1;
	while(b)
	{
		if(b&1)
			ans=(ans*a)%m;
		b/=2;
		a=(a*a)%m;
	}
	return ans;
}

int fact[N], invfact[N];

int modinv(int k)
{
	return pow(k, MOD-2, MOD);
}

void precompute()
{
	fact[0]=fact[1]=1;
	for(int i=2;i<N;i++)
	{
		fact[i]=fact[i-1]*i;
		fact[i]%=MOD;
	}
	invfact[N-1]=modinv(fact[N-1]);
	for(int i=N-2;i>=0;i--)
	{
		invfact[i]=invfact[i+1]*(i+1);
		invfact[i]%=MOD;
	}
}

int nCr(int x, int y)
{
	if(y>x)
		return 0;
	int num=fact[x];
	num*=invfact[y];
	num%=MOD;
	num*=invfact[x-y];
	num%=MOD;
	return num;
}


int a, b, x;
string s, t;
int dp[N], pref[N];

int32_t main()
{
	precompute();
	IOS;
	cin >> s >> t;
	cin >> x;
	for(int i = 0; i < s.length(); i ++)
	{
		if(s[i] == t[i]) 
			a++;
		else 
			b++;
	}

	for(int i = 0; i <= b; i++)
	{
		// dp[i] = no.of changes to b such that i of them are involving changing both
		// = bCi * 24^i * 2^(b-i)
		int ways = nCr(b, i) * pow(24, i, MOD);
		ways %= MOD;
		ways *= pow(2, b - i, MOD);
		ways %= MOD;
		dp[i] = ways;
		if(i == 0) 
			pref[0] = dp[0];
		else 
		{
			pref[i] = pref[i - 1] + dp[i];
			pref[i] %= MOD;
		}
	}
	for(int i = b + 1; i < N; i++)
		pref[i] = pref[i - 1];
	int ans = 0;

	for(int i = 0; 2 * i + b <= x && i <= a; i++)
	{
		// 2*i operators to the same characters
		// 25^i * aCi
		int ways = pow(25, i, MOD) * nCr(a, i);
		ways %= MOD;
		int gg = x - b - 2 * i; // max no. of changes to b where u change both of them
		ways *= pref[gg];
		ways %= MOD;
		ans += ways;
		ans %= MOD;
	}
	cout << ans << endl;
	return 0;
}, In this Programming Language: C++, Now tell me if this Code is compilable or not?