UKG Interview Question

Count the Number of Good Subsequences