C++ SOLUTION || EASY TO UNDERSTAND || BRUTE FORCE AND OPTIMIZED SOLUTION
\n\n# BRUTE FORCE\n\n\n    class Solution {\n    public:\n    int numOfPairs(vector& nums, string target) {\n        int cnt=0;\n        for(int i=0;i<nums.size
\n\n# BRUTE FORCE\n\n\n    class Solution {\n    public:\n    int numOfPairs(vector<string>& nums, string target) {\n        int cnt=0;\n        for(int i=0;i<nums.size();i++){\n            for(int j=0;j<nums.size();j++){\n                if(i==j){\n                    continue;\n                }\n                if(nums[i]+nums[j]==target){\n                    cnt++;\n                }\n            }\n        }\n        return cnt;\n        }\n      };\n\t  \n\t  \n# OPTIMIZED SOLUTION\n\n\n    class Solution {\n    public:\n    int numOfPairs(vector<string>& nums, string target) {\n        unordered_map<string,int>mp;\n        for(int i=0;i<nums.size();i++){\n            mp[nums[i]]++;\n        }\n        string check1="",check2="";\n        int ans=0;\n        for(int i=0;i<target.length();i++){\n            check1+=target[i];\n            check2=target.substr(i+1);\n            if(mp.find(check1)!=mp.end() and mp.find(check2)!=mp.end()){\n                if(check1==check2){\n                    ans+=mp[check1]*(mp[check1]-1);\n                }\n                else{\n                    ans+=mp[check1]*mp[check2];\n                }\n            }\n        }\n        return ans;\n       }\n     };
['C']