SIMPLE TWO-POINTER C++ SOLUTION
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(nlog(n))\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```\n\nclass Solution {\npublic:\n  int countPairs(vector<int>& nums , int target){ \n      sort(nums.begin() , nums.end()); \n      int ans = 0; \n      int left = 0;\n      int right = nums.size() -  1; \n      while(left < right){ \n          if(nums[left] + nums[right] < target){\n              ans+=right-left; \n              left++; \n          }else{ \n              right--; \n          }\n      }     return ans;\n  } // After sorting the array in increasing order,\n// if the sum of the elements at the left and right pointers, (nums[left] + nums[right]) is less than the target,\n// we can be sure that all elements between left and right will also satisfy the condition nums[i] + nums[j] < target when paired with nums[left].\n \n};\n```\n```
['C++']