Given a string, count the number of distinct subsequences of it ( including empty subsequence ). For the uninformed, A subsequence of a string is a new string which is formed from the original string by deleting some of the characters without disturbing the relative positions of the remaining characters. For example, “AGH” is a subsequence of “ABCDEFGH” while “AHG” is not.
Input Format
First line of input contains an integer ‘t’ denoting number of test cases.
Next t lines contain a string each.
Constraints
1<=t<=100
1<=length of s<=100000
s will contain upper letters only.
Output Format
For each test case ,print ans%1000000007 in a new line each ,where ans is the number of distinct subsequences.
my solution:-https://ide.codingblocks.com/s/260290