Implement a function that, given an integer array nums and an integer target T, returns all unique triplets [x, y, z] from nums such that x + y + z = T. Requirements: avoid duplicate triplets (enforce x <= y <= z within each triplet), return results in lexicographic order, and aim for O(n^ 2) time using sorting and a two-pointer strategy with O(