java | Simple Brute Force Solution | StringBuilder
\nint count = 0;\n    public int numOfPairs(String[] nums, String target) {\n        int n = nums.length;     // for Eg: nums[] = ["123", "4"] and target = "123
```\nint count = 0;\n    public int numOfPairs(String[] nums, String target) {\n        int n = nums.length;     // for Eg: nums[] = ["123", "4"] and target = "1234"\n        StringBuilder ans = new StringBuilder();\n        for(int i = 0; i < n; i++){\n\t\t    // add nums[i] in ans, ans = "123"\n            ans.append(nums[i]);\n            for(int j = 0; j < n; j++){\n                if(i != j){\n\t\t\t\t    //add nums[j] in ans, ans = "123" + "4" = "1234"\n                    ans.append(nums[j]);\n\t\t\t\t\t//Check if ans == target\n                    if(ans.toString().equals(target) == true){\n                        count++;\n                    }\n\t\t\t\t\t//remove nums[j] added in ans, so delete everything added after nums[i] to last, ans = "123"\n                    ans.delete(nums[i].length(), ans.length());\n                }\n            }\n\t\t\t//remove nums[i] added in ans, ans = "" \n\t\t\tans.delete(0,  ans.length());\n        }\n        return count;\n    }\n```
['String', 'Java']