c++, Brute force, easy to understand
class Solution {\npublic:\n    int countPairs(vector& nums, int target) {\n        \n        int n = nums.size();\n        int i,j;\n        int count = 0;\n   
class Solution {\npublic:\n    int countPairs(vector<int>& nums, int target) {\n        \n        int n = nums.size();\n        int i,j;\n        int count = 0;\n        sort(nums.begin(),nums.end());\n        for(i=0;i<n;i++)\n        {\n            for(j=i+1;j<n;j++)\n            {\n                if(nums[i] + nums[j] < target)\n                {\n                    count++;\n                }\n                else\n                {\n                    break;\n                }\n            }\n        }\n        return count;\n    }\n};
['C', 'Sorting']