Simplest O(N²) solution
Intuition\nAs i is always lesser than j and i may be zero for all j\'s, then loop through the list starting by i + 1 (j) and counting the nums[i] + nums[j] < ta
# Intuition\nAs `i` is always lesser than `j` and `i` may be zero for all `j`\'s, then loop through the list starting by `i + 1` (`j`) and counting the `nums[i] + nums[j] < target` seemed the best approach\n\n# Complexity\n- Time complexity:\nO(N\xB2)\n\n- Space complexity:\no(1)\n\n# Code\n```\nclass Solution {\n    fun countPairs(nums: List<Int>, target: Int): Int {\n        var counter = 0\n        for (i in nums.indices) {\n            for (j in i+1 until nums.size) {\n                if (nums[i] + nums[j] < target) counter++\n            }\n        }\n        return counter\n    }\n}\n```
['Kotlin']