Company: Google_5july
Difficulty: medium
Count subsequences Problem Description Determine the number of non-empty subsequences of array A such that they do not exist three consecutive odd or three consecutive even integers in the subsequence. As the answer can be large, print it modulo 10 9 + 7. Notes: Assume 1-based indexing. A subsequence of array A can be obtained by deleting some array elements while keeping the order of other elements intact. Function Description: Complete the solve function provided in the editor. This function takes the following 2 parameters and returns the required answer: N : Represents the number of elements in array A A : Represents the elements of array A Input format: The first line contains a single integer T , which denotes the number of test cases. T also specifies the number of times you have to run the solve function on a different input set. For each test case: The first line contains an integer N . The second line contains N space-separated integers denoting the array A . Output format: F