Rust | 0ms | beats 100%
Complexity\n- Time complexity: O(n^2 * |target|)\n\n- Space complexity: O(1)\n\n# Code\n\nimpl Solution {\n    pub fn num_of_pairs(nums: Vec<String>, target: St
# Complexity\n- Time complexity: $$O(n^2 * |target|)$$\n\n- Space complexity: $$O(1)$$\n\n# Code\n```\nimpl Solution {\n    pub fn num_of_pairs(nums: Vec<String>, target: String) -> i32 {\n        let mut ans = 0;\n        for i in 0..nums.len()-1 {\n            for j in i+1..nums.len() {\n                if nums[i].len() + nums[j].len() == target.len() {\n                    if target[..nums[i].len()] == nums[i] && target[nums[i].len()..] == nums[j] {\n                        ans += 1;\n                    }\n                    if target[..nums[j].len()] == nums[j] && target[nums[j].len()..] == nums[i] {\n                        ans += 1;\n                    }\n                }\n            }\n        }\n        ans\n    }\n}\n```
['Rust']