Assume that the last element of the set is used as partition element in Quicksort. If $n$ distinct elements from the set $\left[1\dots n\right]$ are to be sorted, give an input for which Quicksort takes maximum time.

3==>quick sort is a unstable algo,so if all elements are same then also it takes o(n^2) time complexity(3rd point is not applicable in this problem as in problem given all the elements are distinct )

If the elements in the array are sorted(ascending/descending), quick sort takes O(n^2). and as the elements are distinct as mentioned in question, third case being if the elements are same doesn’t apply here. The above mentioned are worst cases for quick sort.