Google | 5 July, 2025 | Count Subsequences | Coding Assessment | Complete Solutions & Tips | Dynamic Programming & Combinatorics | July 5th Assessment

Google · Question · Posted Apr 2026

Count subsequences Problem Statement: You are given an array A of N integer elements. Task Determine the number of the non-empty subsequences of array A such that there do not exist three consecutive even or three consecutive odd 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. Example ...

The full answer & interview discussion are available to premium members.

Log in Create a free account