Whenever such questions are asked we need to find out the best algo (that is the most efficient one) which can help us in getting the result.
By worst it means the worst case scenario when we use this most efficient algo.
There is no meaning if they ask us for the unoptimized algo because that doesn't test our ability of thinking.
Here once we sort the algo using merge sort, if the difference b/w the first 2 elements=k then that is the best case and if the difference b/w the last 2 elements is k then that is the worst case as we have to increment the i and j pointer throughout the sorted array.
Eg: let the sorted array be 1,2,4,11 and k=7
i and j both point to 1.
|ar[i]-ar[j]|=| 1-1 |=0 but 0<k so j++
|ar[i]-ar[j]|=| 1-2 |=1 but 1<k so j++
|ar[i]-ar[j]|=| 1-4 |=3 but 3<k so j++
|ar[i]-ar[j]|=| 1-11 |=10 but 10>k so i++
|ar[i]-ar[j]|=| 2-11 |=9 but 9>k so i++
|ar[i]-ar[j]|=| 3-11 |=8 but 8>k so i++
|ar[i]-ar[j]|=| 4-11 |=7 but 7==k FOUND!!
So in this case we have to shift the variables for the max no. of times hence the worst case