Tell me about your approach to given an array of integers, produce all ways to reach a target value using three elements. Implement three_sum_target(nums, target) to return every unique combination of three distinct array elements whose values sum to target. Return each combination in nondecreasing order, omit duplicate combinations, and return the combinations in lexicographic order.
def three_sum_target(nums, target):