For this Question: Newton has made a function that run's infinite and return a string <b>Newton</b> after it's every call. When he terminates the function he received a big concatenated strings like <b>wtonNewtonNe</b>, <b>NewtonNew</b>, <b>onNew</b> on his screen. Now he really want's to confirm that wether such strings which he received on his screen are really a substring of <b>NewtonNewtonNewton.....</b> (Newton here is repeated many times in a row).
Newton is unable to write a code, can u write a code for him?The first line of the input contains a space separated integer T.
For each test case there is a single string of latin letters <b>s</b> - the one which displayed on a screen.

<b>Constraints</b>
1 ≤ T ≤ 1000
1 ≤ |s| ≤ 1000Print "YES" if it's a substring of <b>NewtonNewtonNewton..... </b> otherwise print "NO".Sample Input
3
NewtonNewton
ewTon
ewtonNew
Sample Output
YES
NO
YES, I have written this Solution Code: #include <bits/stdc++.h>

using namespace std;

#ifdef LOCAL
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) 2351
#endif

// newtonnn

int32_t main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    auto start = std::chrono::high_resolution_clock::now();

    auto solve = [&]() {
        string str;
        cin >> str;
        // transform(str.begin(), str.end(), str.begin(), ::tolower);
        vector<char> cycle = {'N', 'e', 'w', 't', 'o', 'n'};
        bool first = true;
        int n = str.size();
        int start = 0;
        for (int i = 0; i < n; i++) {
            if (find(cycle.begin(), cycle.end(), str[i]) != cycle.end()) {
                if (first) {
                    first = false;
                    if (str[i] == 'N') {
                        start = 1;
                    } else if (str[i] == 'e') {
                        start = 2;
                    } else if (str[i] == 'w') {
                        start = 3;
                    } else if (str[i] == 't') {
                        start = 4;
                    } else if (str[i] == 'o') {
                        start = 5;
                    } else {
                        start = 6;
                    }
                } else {
                    if (str[i] != cycle[start % 6]) {
                        cout << "NO\n";
                        return;
                    } else {
                        start += 1;
                    }
                }
            } else {
                cout << "NO\n";
                return;
            }
        }
        cout << "YES\n";
    };

    int tt;
    cin >> tt;
    while (tt--) {
        solve();
    }

    auto stop = std::chrono::high_resolution_clock::now();
    auto duration = std::chrono::duration_cast<std::chrono::nanoseconds>(stop - start);
    cerr << "Time taken : " << ((long double)duration.count()) / ((long double)1e9) << "s " << endl;
    return 0;
}, In this Programming Language: C++, Now tell me if this Code is compilable or not?