This post was flagged by the community and is temporarily hidden.
You didn’t initialize the vector. Initialize it first vector<int> vect(n);
This post was flagged by the community and is temporarily hidden.
You didn’t initialize the vector. Initialize it first vector<int> vect(n);