To see the question, click here.
Naive Approach
The idea is to store all the values of the list nodes in an array, sort them using the Arrays.sort method, and then construct the linked list to return it as the answer.
// TC: O(nlogn)
// SC: O(n)
imp...