Find out my mistake
the minimum value for the binary search has to be the maximum value of the array
int start =0
for(int i=0;i<n;i++){start = max(start ,a[i]); sum+=a[i];}
int s=start,e=sum,mid,ans;
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.