This is showing the wrong answer…
What is incorrect in the code??
Agressive cows [Divide and conquer]
@a19JE0093
there is mistake in line no 4. Initial cnt should be 1 since you already placed one cow at ar[0]/
Change line 4 to int cnt=1; All testcase will pass.