Question
write a program in c language You are given an array A of N integers: A 1 , A 2 , ..., A N .
write a program in c language You are given an array A of N integers: A1, A2, ..., AN. You need to find a longest contiguous subarray in the array such that each integer in this subarray is an even integer, and output its length.
A contiguous subarray is of the form Ai, Ai+1, ..., Aj, for some i and j.
Input
The first line of the input contains an integer T denoting the number of test cases. The description of each test case follows.
The first line of each test case contains a single integer N denoting the number of elements in the given array.
The second line contains N space-separated integers A1, A2, ..., AN denoting the array A.
Output
For each test case, output a single line containing the answer.
Constraints
1 T 10
1 N 105
0 A1, A2, ... , AN 105
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started