### PROBLEM LINK:

**Author:** Praveen Dhinwa

**Tester:** Praveen Dhinwa and Hiroto Sekido

**Editorialist:** Lalit Kundu

### DIFFICULTY:

CakeWalk

### PREREQUISITES:

None at all

### PROBLEM:

Given an array of integers a_{1},a_{2}…a_{n}, check whether there is a subarray which consists of exactly k even integers.

### EXPLANATION:

Since n<=50, you can traverse over all subarrays and count how many even numbers are there in each substring. Complexity: O(N^{3}).

Or, we can do this cleverly. If there are atleast k even numbers in the whole array, we can always pick a subarray which will contain k even numbers.

One tricky case would be k=0, and all numbers are even in the array. In this case we can’t pick any subarray.