Max Odd Numbers in K Window

Sliding Window / 2 Pointer Contest Medium

Given an integer array nums and an integer k, return the maximum number of odd numbers present in a subarray of size k within nums.

Constraints

  • 1 <= nums.length <= 105
  • -104 <= nums[i] <= 104
  • 1 <= k <= n


Company Tags

[ ]