Why my code is showing wrong output?Kindly modify the mistake
@vanshikasharma1645
Your code was not working because you didnt sort the array of coordinates of the barns.
This should fix the issue.
If my solution is able to answer the query, please mark the doubt as resolved.