Wordle Solution
Codechef March Long Challenge 2022 - I
Problem Code : WORDLE
Solution :
#include <bits/stdc++.h>
#define ll long long int
#define ull unsigned long long int
using namespace std;
void solve()
{
string s, t;
cin >> s >> t;
string ans = "";
for (ll i = 0; i < s.size(); i++)
{
if (s[i] == t[i])
{
ans += 'G';
}
else
{
ans += 'B';
}
}
cout << ans << "\n";
}
int main()
{
ll t;
cin >> t;
while (t--)
{
solve();
}
}
Comments
Post a Comment