You are given two integers l and r, and a string directions.
For any integer x, consider its
A path on the grid begins at cell directions, where 'D' denotes moving down one cell and 'R' denotes moving right one cell.
An integer x is defined as good if the sequence of digits visited along the path is non decreasing.
Return the count of good integers x such that l r.
Constraints:
l r
directions.length
directions consists of exactly three 'D' characters and three 'R' characters.
You are given two integers l and r, and a string directions.
For any integer x, consider its
A path on the grid begins at cell directions, where 'D' denotes moving down one cell and 'R' denotes moving right one cell.
An integer x is defined as good if the sequence of digits visited along the path is non decreasing.
Return the count of good integers x such that l r.
Constraints:
l r
directions.length
directions consists of exactly three 'D' characters and three 'R' characters.