Company: Emergent_13_feb
Difficulty: medium
3. Count Nice Sub Array Problem Description Given an array of integers nums and an integer k . A continuous subarray is called nice if there are k odd numbers on it. Return the number of nice subarrays. Input Format Two lines: An integer k representing the required number of odd numbers. A line of space-separated integers representing the array nums . Output Format A single integer representing the number of nice subarrays. Constraints 1 <= nums.length <= 50000 1 <= nums[i] <= 10^5 1 <= k <= nums.length Test Cases Test Case 1: Input: 3 1 1 2 1 1 Output: 2 Explanation: The only subarrays with 3 odd numbers are [1,1,2,1] and [1,2,1,1]. Test Case 2: Input: 1 2 4 6 Output: 0 Explanation: There are no odd numbers in the array. Test Case 3: Input: 2 2 2 2 1 2 2 1 2 2 2 Output: 16 Explanation: There are 16 subarrays with exactly 2 odd numbers. Execution time limit: 10 seconds