Company: Uber Oncampus_19july
Difficulty: hard
Imagine a city divided into zones, labelled from 0 to n . An Uber driver follows a planned sequence of navigation instructions, where 'l' = move one zone left (toward a lower-numbered zone), 'r' = move one zone right (toward a higher-numbered zone). You are asked to determine: how many distinct subsequences of the driver's navigation plan allow the driver to start at zone start_zone and successfully reach zone end_zone ? Since the number of subsequences can be large, return the result modulo 10 9 + 7. Notes A subsequence is formed by deleting zero or more navigation steps without changing the order of the remaining steps. Two subsequences are considered the same if they consist of the same navigation instructions, even if chosen from different indices. For example, in "rrl" , the subsequence "rl" formed by deleting the first r is the same as "rl" formed by deleting the second r . Both count only once. Starting at position j , an instruction 'l' moves to position j - 1 and an instructio