easy peasy python solution with explanation
\t# Just keep count of the current odd number.\n\t# Look in the dictionary if we can find (currendOds - k), \n\t# if it exisits that means I can get an subarray
\t# Just keep count of the current odd number.\n\t# Look in the dictionary if we can find (currendOds - k), \n\t# if it exisits that means I can get an subarray with k odds.\n\t# Also keep count of number of different types of odds too,\n\t# because for K =1 , [2,2,1] is a valid list, so does, [2,1] and [1].\n\t\n        def numberOfSubarrays(self, nums: List[int], k: int) -> int:\n\t\t\tdic = { 0: 1 }\n\t\t\tcnt = res = 0\n\t\t\tfor idx, num in enumerate(nums):\n\t\t\t\tif num % 2 == 1:\n\t\t\t\t\tcnt += 1\n\n\t\t\t\tif cnt - k in dic:\n\t\t\t\t\tres += dic[cnt-k]\n\n\t\t\t\tdic[cnt] = dic.get(cnt, 0) + 1\n\n\t\t\treturn res
['Python', 'Python3']