[C++] using unordered map and string functions
\nint numOfPairs(vector<string>& nums, string target) {\n    int n=nums.size();\n    int ans=0;\n    unordered_map<string,int> mp;\n    for(int i=0;i<n;++i){\n 
```\nint numOfPairs(vector<string>& nums, string target) {\n    int n=nums.size();\n    int ans=0;\n    unordered_map<string,int> mp;\n    for(int i=0;i<n;++i){\n        mp[nums[i]]++;\n    }\n    for(int i=0;i<n;++i){\n        if(nums[i]==target.substr(0,nums[i].size())){\n            string remaining=target.substr(nums[i].size());\n            if(mp.find(remaining)!=mp.end()){\n                ans+=mp[remaining];\n                if(remaining==nums[i]){\n                    ans--;\n                }\n            }\n        }\n    }\n    return ans;\n}\n```
['C']