As always, what is the time complexity for the algorithm exercise?
Implement count_target_pairs(nums, target) to count distinct index pairs (i, j) where i < j and nums[i] + nums[j] == target. Return the count as an integer and analyze the time and space complexity.
Function signature: count_target_pairs(nums, target)
def count_target_pairs(nums, target):