C# Two Pointers approach 65ms && 45.2MB
Sorting the arrays and moving the pointers around according to the combination of numbers\n\n# Code\n\npublic class Solution {\n    public int NumberOfPairs(int
Sorting the arrays and moving the pointers around according to the combination of numbers\n\n# Code\n```\npublic class Solution {\n    public int NumberOfPairs(int[] nums1, int[] nums2, int k) {\n        Array.Sort(nums1);\n        Array.Sort(nums2);\n        int n = nums1.Length, m = nums2.Length;\n        int resCount = 0;\n        int left = 0, right = 0;\n        while (left < n)\n        {\n            if(right >= m || nums1[left] < nums2[right] * k)\n            {\n                left++;\n                right = 0;\n            }\n            else if (nums1[left] % (nums2[right] * k) == 0)\n            {\n                resCount++;\n                right++;\n            }\n            else if (nums1[left] > nums2[right] * k)\n                right++;\n        }\n        return resCount;\n    }\n}\n```
['C#']