Need Help in Directi online assessment (OA) problem

Anonymous User
301
Nov 10, 2023

Hello everyone,

I encountered this problem during the Directi OA, and unfortunately, I couldn't find a solution. I would greatly appreciate your assistance with this problem.

Thanks

Description
Problem Statement

You are given a string s of length n. You want to find all the distinct non-empty strings that can be formed from s such that:

No two adjacent characters from the string s are chosen in the string that we make from s.
Since the answer can be large print it modulo 10^9+7.

Input Format

The only line of input contains a string s.
Constraints

1 <= n <= 10^5
Output Format

Return an integer as asked.
Evaluation Parameters

Sample Input
dd
Sample Output
1
Comments (3)