Aggressive Cows

whats wrong with my code its not passing all the test cases https://ide.codingblocks.com/s/173780

There are few problem areas,
like mid = (s+e)/2;
in aggr_cows() value of end has to be e = a[n-1] and not a[n-1]-a[0]

just these two mistakes
You may Refer the updated code

1 Like