Sample test cases are passed
Testcase 0-TLE; Testcase 1-Wrong Answer
@ambuj_0909 you need to first sort the array, then divide the array for getting max diff divide the array from mid, for getting min difference, put alternate elements in one array,(one array will have elements as 0,2,4,6 so on)
If this resolves your doubt mark it resolved.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.