Simple Solution || Beginner Friendly ||Proper Explanation || Beats 98% ||
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:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\n    public int countPairs(List<Integer> nums, int target) {\n        int i=0;//to point left\n        int j=0;//to point right\n        int count=0;//to count the pair\n       for(i=0;i<nums.size();i++)//to increase left pointer\n       {\n            for(j=i+1;j<nums.size();j++)//to increase right pointer\n            {\n             if(nums.get(i)+nums.get(j)<target)//if i and j pointer element are less than targer than count increase\n            {\n                count++;\n            }\n            }\n            \n        }\n        return count; //return count\n        \n    }\n}\n```
['Array', 'Two Pointers', 'Java']