Java-1ms|Beats 100.00%
\n\n# Approach\n1. Conversion to Array\n2. Iterating Over Pairs\n3. Counting Valid Pairs\n\n# Complexity\n- Time complexity:\nO(N^2)\n\n- Space complexity:\n Ad
\n\n# Approach\n1. Conversion to Array\n2. Iterating Over Pairs\n3. Counting Valid Pairs\n\n# Complexity\n- Time complexity:\nO(N^2)\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```java []\nclass Solution {\n    public int countPairs(List<Integer> nums, int target) {\n        int[] n=new int[nums.size()];\n        for (int i = 0; i < nums.size(); i++)\n            n[i] = nums.get(i);\n        int k=0;\n        for(int i=0;i<n.length;i++)\n            for(int j=i+1;j<n.length;j++)\n                if(n[i]+n[j]<target)    k++;\n        return k;\n    }\n}\n```
['Java']