Can we reduce the time complexity from O(n^2logn)?
You can do this question in O(n^2) complexity, simply by sorting the array first, then u can maintain two pointers, left pointer and right pointer, and keep the third pointer in fixed value, and then subtract the fixed pointer value from the target, and then, calculate the remaining sum by adding left and right pointer, and if it comes out to be equal to the new target, then that triplet will be printed.