Help me in solving ACCESS problem

My issue

in vs code my answer is correct but in codechef compiler its giving wrong solution

My code

#include <bits/stdc++.h>
using namespace std;

int main() {
    int t;
    cin >> t;
    while (t--) {
        int n, swipes;
        cin >> n >> swipes;
        bool arr[n];
        for (int i = 0; i < n; i++) {
            cin >> arr[i];
        }
        int flag = 1;
        int swipe = 0;
        for (int i = 0; i < n; i++) {
            if (arr[i]) {
                swipe = swipes;
            } else {
                swipe = swipe - 1;
                if (swipe < 0) {
                    flag = 0;
                }
            }
            if (flag == 0) {
                break;
            }
        }
        if (flag == 1) {
            cout << "YES\n";
        } else {
            cout << "NO\n";
        }
    }
    return 0;
}

Problem Link: Access Control Practice Coding Problem - CodeChef

you got wrong answer because you took array of Boolean values. But in input we have string like input(no spaces in input). so it is advised to use character array(string) is advised to use. In vs code we give individual input so you code gives no error in vs code. so to get correct output just replace bool arr[i] with char arr[i].