Below is the problem statement that I have:
You get number written in base 10, you have to delete it completely by choosing two consecutive digits and deleting them. But the sum of those 2 digits should not be 17. We call the numbers which are fully deleted by repeating the above operation as "Good".
Example:
9889=> Delete88to get9999=> Delete99to fully delete number. Conclusion: 9889 is good. NOTE: We cannot remove98or89as the sum of these 2 digits is17.
Given a number N(even) you want to find the number of good N-digit number modulo 10^9 + 7. Include in the count the N digit numbers containing leading zeros, too.
Test Cases:
Case 1:
Input: 2
Output: 98
Case 2:
Input: 4
Output: 9926
Case 3:
Input: 442
Output: 417551213
I have tried solving this using various codes but not able to get the result.