Help me in solving S100 problem

My issue

can anyone explain the problem statement

My code

#include <iostream>
using namespace std;

// Function to check if a string starts with "110"
bool stringSt(string a) {
    return a=="110";
}

int main() {
    int t;
    cin >> t;
    while (t--) {
        int n;
        cin >> n;
        string s;
        cin >> s;
        int i = 0;
        while (i < n) {
            if (i+2<n&&stringSt(s.substr(i))) {
                s=s.substr(0,i)+"100"+s.substr(i+3); 
                i+=3;      
            }
            else 
                i++;        
        }

        cout << s << endl;
    }
    return 0;
}

Problem Link: S100 Problem - CodeChef