Please check where am i going wrong
Mistakes
-
at line no 41 run while loop
while(s<=e) -
correct condition
if(possible(mid, arr,n)<=p){
e=mid-1;
ans=mid;
}
else if(possible(mid, arr, n)>p){
s=mid+1;
}
- at line no 25 first you have to take p and then n;
look at modified Code below
Modified Code
if you have some doubt regarding this feel free to ask
i hope this helps
if yes show your response with
and don’t forgot to mark doubt as resolved