✅✅🔥🔥Beginner friendly code(very easy) TC 0(N^2)  SC 0(1)💯💯
Intuition\n Describe your first thoughts on how to solve this problem. \nWe need to count the number of pairs of strings in the array that concatenate to form a
Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nWe need to count the number of pairs of strings in the array that concatenate to form a given target string. This suggests a nested loop approach where we consider every possible pair of strings in the array and check if their concatenation matches the target string.\n\nApproach\n<!-- Describe your approach to solving the problem. -->\nInitialize a counter to keep track of the number of valid pairs.\nUse two nested loops to iterate through all possible pairs of strings in the array.\nFor each pair of strings, concatenate them in both possible orders and check if either concatenation matches the target string.\nIf a match is found, increment the counter.\nReturn the counter as the final result.\nComplexity\nTime complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\nThe time complexity is \n\nO(n^2) \nsince we have two nested loops iterating through the array of size \nn.\n\nSpace complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\nThe space complexity is \nO(1) as we are using only a constant amount of extra space.\n\n# Code\n```\nclass Solution {\npublic:\n    int numOfPairs(vector<string>& nums, string target) {\n        int n=nums.size();\n        int count=0;\n\n        for(int i=0;i<n;i++)\n        {\n            for(int j=i+1;j<n;j++)\n            {\n                if(nums[i]+nums[j]==target)\n                {\n                    count++;\n                }\n\n                if(nums[j]+nums[i]==target)\n                {\n                    count++;\n                }\n            }\n        }\n\n\n        return count;\n    }\n};\n```
['C++']