package com.fishercoder.solutions;

/**
 * 1248. Count Number of Nice Subarrays
 *
 * Given an array of integers nums and an integer k. A subarray is called nice if there are k odd numbers on it.
 *
 * Return the number of nice sub-arrays.
 *
 * Example 1:
 * Input: nums = [1,1,2,1,1], k = 3
 * Output: 2
 * Explanation: The only sub-arrays with 3 odd numbers are [1,1,2,1] and [1,2,1,1].
 *
 * Example 2:
 * Input: nums = [2,4,6], k = 1
 * Output: 0
 * Explanation: There is no odd numbers in the array.
 *
 * Example 3:
 * Input: nums = [2,2,2,1,2,2,1,2,2,2], k = 2
 * Output: 16
 *
 * Constraints:
 * 1 <= nums.length <= 50000
 * 1 <= nums[i] <= 10^5
 * 1 <= k <= nums.length
 * */
public class _1248 {
    public static class Solution1 {
        public int numberOfSubarrays(int[] nums, int k) {
            for (int i = 0; i < nums.length; i++) {
                for (int j = 0; j < nums.length; j++) {

                }
            }
            return -1;
        }
    }
}

@@ -33,658 +33,8 @@
 s;%0A%0A
-/**%0A * 1248. Count Number of Nice Subarrays%0A *%0A * Given an array of integers nums and an integer k. A subarray is called nice if there are k odd numbers on it.%0A *%0A * Return the number of nice sub-arrays.%0A *%0A * Example 1:%0A * Input: nums = %5B1,1,2,1,1%5D, k = 3%0A * Output: 2%0A * Explanation: The only sub-arrays with 3 odd numbers are %5B1,1,2,1%5D and %5B1,2,1,1%5D.%0A *%0A * Example 2:%0A * Input: nums = %5B2,4,6%5D, k = 1%0A * Output: 0%0A * Explanation: There is no odd numbers in the array.%0A *%0A * Example 3:%0A * Input: nums = %5B2,2,2,1,2,2,1,2,2,2%5D, k = 2%0A * Output: 16%0A *%0A * Constraints:%0A * 1 %3C= nums.length %3C= 50000%0A * 1 %3C= nums%5Bi%5D %3C= 10%5E5%0A * 1 %3C= k %3C= nums.length%0A * */%0A
 publ
@@ -252,16 +252,56 @@
  j++) %7B%0A
+                    //TODO: implement it
 %0A       

refactor 1248