Brute Force Method and Two Pointer Approach!
Brute Force Method:\n# Code\n\nclass Solution:\n    def countPairs(self, nums: List[int], target: int) -> int:\n        count = 0\n        for i in range(len(nu
# Brute Force Method:\n# Code\n```\nclass Solution:\n    def countPairs(self, nums: List[int], target: int) -> int:\n        count = 0\n        for i in range(len(nums)-1):\n            for j in range(len(nums)):\n                if(i < j and nums[i] + nums[j] < target):\n                    count = count + 1\n        return count\n```\n\n# Two Pointer Method:\n\n# Code\n```\nclass Solution:\n    def countPairs(self, nums: List[int], target: int) -> int:\n        nums.sort()\n        count = 0\n        left = 0\n        right = len(nums)-1\n        while(left < right):\n            if(nums[left] + nums[right] < target):\n                count = count + (right - left)\n                left = left + 1\n            else:\n                right = right - 1\n        return count\n```
['Python3']