Need Help in - HORSES Question

Question: https://www.codechef.com/problems/HORSES
Solution: https://www.codechef.com/viewsolution/24023941
O/P: WA

Can’t pass cases. Needed advise what went wrong.

Hi @achi,

You don’t need to check for all possible combinations of differences in the array. You just need to sort the array and find the minimum difference between two adjacent elements.

This is my Python implementation: https://www.codechef.com/viewsolution/24027410

Please let me know if you got AC. Feel free to ask any other doubts.

Cheers
Aadarsh…