Skip to content

Latest commit

 

History

History
14 lines (11 loc) · 462 Bytes

File metadata and controls

14 lines (11 loc) · 462 Bytes

Problem 14: Predicate Parity Count (Count Number of Nice Subarrays)

Problem Statement

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

  • An array of integers nums.
  • An integer k.

Example

Input: nums = [1, 1, 2, 1, 1], k = 3
Output: 2 Explanation: The nice subarrays are [1, 1, 2, 1] and [1, 2, 1, 1].