Company: Infoedge_27april
Difficulty: medium
Multiverse Possibilities Problem Description Given a string named year of length n . It contains only digits. Now there are various universes in the world and every universe has its own timeline. To sort out the time on planets in a single universe we count them based on their year at a particular moment. Now given a string that contains years of different planets in a single universe. It is hard to find the years since there are no commas or spaces and the first digit will never be '0' and the years in the string are strictly increasing . Since every different possibility proves a different universe in the multiverse, find out the number of universes present in the multiverse. The integer can be very long so return the modulo of answer by 10 9 + 7. Input Format The first line contains the length of the string n. The second line contains the string year. Output Format Return the number of possible ways to have a multiverse. Examples Example 1: Input: 8 20152016 Output: 4 Explanation: T