C Solution || Beats 100% | O(n^2) Runtime && O(1) Space
Intuition\nWe must check every possible combination such that the concatenation of two strings is equal to target. We do not have to actually concatenate and wa
# Intuition\nWe must check every possible combination such that the concatenation of two strings is equal to target. We do not have to actually concatenate and waste space, all we have to do is iterate through each string and, for each as well, iterate through all of the others (except itself). For all that satisfy the condition, increment the counter variable.\n\n# Approach\nCreate two functions, one that compares the first string with the target (such that it does not exactly equal the target, as the string will never be empty, same for the target). Then, use the second function in a similar fashion, however, you have to make sure it matches with the rest of the target (ind variable is used for that sort of thing, as you may be able to see in the code I wrote). Then, iterate through each variable (just like I explained in my intuition) and then through each other variable for that one if that one matches a prefix of target. Then, check if there\'s any others that match the remaining suffix of the target. Increment the counter for each. Return the counter. That\'s it!\n\n# Complexity\n- Time complexity: O(n^2)\n\n- Space complexity: O(1)\n\n# Code\n```\nint numOfPairs(char** nums, int numsSize, char* target) {\n\n    //compares prefix\n    int comparePrefix(char* s, int ind) {\n        int i = 0;\n        while (1) {\n            if (s[i] == 0 && target[ind + i] != 0) {\n                return i;\n            }\n            if (s[i] == 0 || target[ind + i] == 0 || s[i] != target[ind + i]) {\n                return 0;\n            }\n            i++;\n        }\n        return 1;\n    }\n\n    //compares suffix\n    int compareSuffix(char* s, int ind) {\n        int i = 0;\n        while (1) {\n            if (s[i] == 0 && target[ind + i] == 0) {\n                return i;\n            }\n            if (s[i] == 0 || target[ind + i] == 0 || s[i] != target[ind + i]) {\n                return 0;\n            }\n            i++;\n        }\n        return 1;\n    }\n\n    int counter = 0;\n    int flag;\n    //loops that iterate through all different indices\n    for (int j = 0; j < numsSize; j++) {\n        flag = comparePrefix(nums[j], 0);\n        if (flag) {\n            for (int k = 0; k < numsSize; k++) {\n                if (k == j) {\n                    continue;\n                }\n                if (compareSuffix(nums[k], flag)) {\n                    counter++;\n                }\n            }\n        }\n    }\n    //returning result of counting\n    return counter;\n}\n```
['C']