can anyone tell what is wrong in this code why its not get accepted for this contest problem: Binary Minimal Practice Coding Problem - CodeChef
// Jai Bajrangbali
include <bits/stdc++.h>
typedef long long ll;
using namespace std;
void sol();
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
ll t = 1;
cin >> t;
while (t–)
{
sol();
}
return 0;
}
void sol()
{
ll n, k;
cin >> n >> k;
string s;
cin >> s;
ll cnt = 0, ans = 0, mx = 0;
for (ll i = 0; i < n; i++)
{
if (s[i] == ‘1’ && k > 0)
{
s[i] = ‘0’;
k–;
}
}
for (ll i = 0; i < n; i++)
{
if (s[i] == ‘1’)
{
cout << s << ‘\n’;
return;
}
}
for (ll i = 0; i < n - k; i++)
cout << “0”;
cout << “\n”;
}