Please help with this problem

Revision en2, by __Nutella__, 2022-02-13 14:30:33

Given a string S consisting of characters 'r' and 'l' and N where N is length of road.

Determine the number of unique subsequences of those moves that lead from a given house x to end at another house y. Moves will be given as a sequence of l and r instructions where l indicates you need to move left and r indicates you need to move right. Return answer modulo 10^9+7

Input format- String (S) N — Length of road x — starting point y — Ending point

rrlrlr 6 1 2

Output- 7

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English __Nutella__ 2022-02-13 14:30:33 9 Tiny change: 'ding point\nExample-\n\nrrlrlr' -> 'ding point \n\n\nrrlrlr'
en1 English __Nutella__ 2022-02-13 14:27:27 561 Initial revision (published)