__Nutella__'s blog

By __Nutella__, history, 3 years ago, In English

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

  • Vote: I like it
  • +1
  • Vote: I do not like it

| Write comment?