Can’t pass cases. Needed advise what went wrong.
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.