Can you please find the mistake here? I am getting runtime error


#1

int Solution::solve(vector &A) {
int n = A.size();
int p=0;
vector pqr;
for(int i=0;i<n;i++)
{
for(int j=0;j<n;j++)
{
if(A[i]>A[j])
{
p++;

        }
        
    }
    pqr[i] = p;
}
int q=0;
for(int i=0;i<n;i++)
{
    if(A[i]==pqr[i])
    {
        return 1;
    }
    else
    {
      q++;   
    }
}
if(q==n)
{
    return -1;
}

}