BFS Algorithm of graph traversal

find out error to here
vector bfs(vector g[], int N) {

// Your code here
vector<bool> *isVisited = new vector<bool>[N];
vector<int> Answer;
queue<int>  Q;

Q.push(0);
isVisited[0] = true;

while(!Q.empty()){
    int front = Q.front();
    Q.pop();
    Answer.push_back(front);
    
   for(auto it = g[front].begin(); it != g[front].end(); it++){
       if(!isVisited[*it]){
           Q.push(*it);
           isVisited[*it] = true;
       }
   }
}
return Answer;

}

this is not correct
to make 1D array of bool use this
bool* isVisited=new bool [N];

i hope this helps
if yes hit a like and don’t forgot to mark doubt as resolved
if you have more doubts regarding this feel free to ask