Simple Approach | Two pointer | O(nlog) | Golang
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity: O(n logn)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: O(1)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nfunc countPairs(nums []int, target int) int {\n    sort.Ints(nums)\n\n    ans, left, right := 0, 0, len(nums) - 1\n    for left < right {\n        if nums[right] + nums[left] < target {\n            ans += right - left\n            left++\n        } else {\n            right--\n        }\n    }\n\n    return ans\n}\n\n```
['Two Pointers', 'Sorting', 'Go']