Python line by line detailed explanation
Based on this solution here is a  line by line detial explanations\n---\n\n##### nums = [2,3,4,6,8],  k = 4\n\n\nclass Solution:\n    def coutPairs(self, nums: 
#### Based on [this solution](https://leetcode.com/problems/count-array-pairs-divisible-by-k/discuss/1784712/Python-O(Nsqrt(K))-Easy-understand-solution) here is a  line by line detial explanations\n---\n\n##### nums = [2,3,4,6,8],  k = 4\n\n```\nclass Solution:\n    def coutPairs(self, nums: List[int], k: int) -> int:\n        N, output = len(nums), 0\n        divisors = []\n        counter = Counter()\n        \n        for i in range(1, k + 1):\n            if k % i == 0:\n                divisors.append(i)\n```\n**For each number, there is the smallest value to multiply that makes it divisible by \'k\'**\nex:  6 should be multiplied by at least 2 to be divisible by 4\n\t&nbsp;&nbsp;&nbsp;&nbsp; 4 should be multiplied by at least 1 to be divisible by 4\n\t&nbsp;&nbsp;&nbsp;&nbsp; 3 should be multiplied by at least 4 to be divisible by 4\n\t\n**Divisors collects all the posiibility of those smallest numbers**\n > divisor = [1,2,4]\n \n\n```\n        for i in range(0, N):\n            remainder = k // math.gcd(k, nums[i])\n\t\t\toutput += counter[remainder]\n```\n**remainder calculate how much num[i] should at least be multiplied to be divisible by \'k\'**\nEx: num[i] = 6 -> reminder = 4 //  gcd(4,6) = 2\n**"counter[remainder]" indicates how many numbers in \'nums\' are divisible by remainder(2)**\n```\n            for divisor in divisors:\n                if nums[i] % divisor == 0:\n                    counter[divisor] += 1\n            \n        return output\n```\n**Then define which group num[i] belongs to**\nEx: nums[i] = 6, then nums[i] is divisible by 1, 2\n\t&nbsp;&nbsp;&nbsp;&nbsp; whick mean if the remainder of nums[n] is 1 or 2 it can pair with \'6\' \n
['Python']