it is showing wrong answer i am unable to find my mistake
Book allocation 628
I have corrected your code, plz try to submit now.
Can you mark where i was making mistake
Firstly, I have included this condition in your code in the function, bool is Valid
if(arr[i]>ans)
{
return false;
}
Then I have ommitted this break, in your loop, if(student>k)
{
return false;
//break;
}
I have added, while(l<=r)
You have only taken l<r,