Company: Google_5july
Difficulty: medium
Count subsequences Problem Description Given an array A, find how many non-empty subsequences of it never contain three odd numbers in a row or three even numbers in a row. Since the count may be huge, report it modulo 10 9 + 7. Notes: Assume 1-based indexing. A subsequence is formed by deleting zero or more elements from A while keeping the relative order of what remains. Function Description: Complete the solve function provided in the editor. This function takes the following 2 parameters and returns the required answer: N : the number of elements in array A A : the elements of array A Input format: The first line contains a single integer T , the number of test cases. T also tells you how many times the solve function must be run, once per 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: For each test case, on its own line, print the count of qualifying non-empty subsequen