Two pointer sol
Approach\nGood explanation here - https://leetcode.com/problems/count-pairs-whose-sum-is-less-than-target/solutions/5358427/c-solution-two-pointer-approach/#:~:
# Approach\nGood explanation here - https://leetcode.com/problems/count-pairs-whose-sum-is-less-than-target/solutions/5358427/c-solution-two-pointer-approach/#:~:text=going%20to%20make.-,Approach,-We%20use%20two\n# Code\n```\nclass Solution {\n    fun countPairs(nums: List<Int>, target: Int): Int {\n        val sortedNums = nums.sorted().toIntArray()\n        var counter = 0\n        var left = 0\n        var right = sortedNums.size - 1\n\n        while (left < right) {\n            val sum = sortedNums[left] + sortedNums[right]\n            if (sum < target) {\n                counter += right - left\n                left++\n            } else {\n                right--\n            }\n        }\n\n        return counter\n    }\n}\n```
['Kotlin']