C++ Hashmap of strings , counting from Prefix+Suffix combinations
class Solution {\npublic:\n    int numOfPairs(vector& nums, string target) {\n            \n        unordered_map mp;\n        \n        int result=0;\n        
class Solution {\npublic:\n    int numOfPairs(vector<string>& nums, string target) {\n            \n        unordered_map<string,int> mp;\n        \n        int result=0;\n        \n        for(auto s:nums){\n            mp[s]++; //Building Frquency of strings\n        }\n        \n        for(int i=1;i<=target.size();i++){\n            //building all combination of prefix and suffix from \n            //target\n            string prefix  = target.substr(0, i);\n            string suffix = target.substr(i, target.size()-i);\n            if(mp[prefix]!=0 && mp[suffix]!=0){\n                \n                if(prefix!=suffix){\n                     //If prefix and suffix are not equal, its just a product\n                     result+=(mp[prefix]*mp[suffix]);\n                    \n                 }\n                else\n                    //Else its a product based on combinations\n                    result+=(mp[prefix]*(mp[prefix]-1));\n            }\n            \n        }\n        \n        return result;\n        \n    }\n};
[]