My code is - https://ide.codingblocks.com/s/326432
It is giving tle why is it so?
Hey correction is in binary search function.
else if(a[mid]>m)
j=m-1; //here it should be mid-1
else
i=m+1; //here it should be mid+1
Hey correction is in binary search function.
else if(a[mid]>m)
j=m-1; //here it should be mid-1
else
i=m+1; //here it should be mid+1