Simple ruby solution
\n# @param {String[]} nums\n# @param {String} target\n# @return {Integer}\ndef num_of_pairs(nums, target)\n    nums.permutation(2).count { _1 + _2 == target }\n
```\n# @param {String[]} nums\n# @param {String} target\n# @return {Integer}\ndef num_of_pairs(nums, target)\n    nums.permutation(2).count { _1 + _2 == target }\nend\n```
['Ruby']