a few solutions
Brute-force consider all i,j pairs.\n    \n---\n    \nKotlin\n\nclass Solution {\n    fun numOfPairs(A: Array<String>, T: String): Int {\n        var N = A.size
Brute-force consider all `i`,`j` pairs.\n    \n---\n    \n*Kotlin*\n```\nclass Solution {\n    fun numOfPairs(A: Array<String>, T: String): Int {\n        var N = A.size\n        var cnt = 0\n        for (i in 0 until N)\n            for (j in 0 until N)\n                if (i != j && "${A[i]}${A[j]}" == T)\n                    ++cnt\n        return cnt\n    }\n}\n```\n\n*Javascript*\n```\nlet numOfPairs = (A, T, cnt = 0) => {\n    let N = A.length;\n    for (let i = 0; i < N; ++i)\n        for (let j = 0; j < N; ++j)\n            cnt += i != j && `${A[i]}${A[j]}` == T;\n    return cnt;\n};\n```\n\n*Python3*\n```\nclass Solution:\n    def numOfPairs(self, A: List[str], T: str, cnt = 0) -> int:\n        N = len(A)\n        for i in range(N):\n            for j in range(N):\n                cnt += i != j and f\'{A[i]}{A[j]}\' == T\n        return cnt\n```\n\n*C++*\n```\nclass Solution {\npublic:\n    using VS = vector<string>;\n    int numOfPairs(VS& A, string T, int cnt = 0) {\n        auto N = A.size();\n        for (auto i{ 0 }; i < N; ++i)\n            for (auto j{ 0 }; j < N; ++j)\n                cnt += i != j && A[i] + A[j] == T;\n        return cnt;\n    }\n};\n```
[]