Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grid Paths #3

Open
codetheorem opened this issue Oct 2, 2020 · 2 comments
Open

Grid Paths #3

codetheorem opened this issue Oct 2, 2020 · 2 comments

Comments

@codetheorem
Copy link
Member

Time limit: 1.00 s Memory limit: 512 MB

There are 88418 paths in a 7×7 grid from the upper-left square to the lower-left square. Each path corresponds to a 48-character description consisting of characters D (down), U (up), L (left), and R (right).

For example, the path

image

corresponds to the description DRURRRRRDDDLUULDDDLDRRURDDLLLLLURULURRUULDLLDDDD.

You are given a description of a path which may also contain characters ? (any direction). Your task is to calculate the number of paths that match the description.

Input

The only input line has a 48-character string of characters ?, D, U, L and R.

Output

Print one integer: the total number of paths.

Example

Input:
??????R??????U??????????????????????????LD????D?

Output:
201

@prajwlr
Copy link
Contributor

prajwlr commented Oct 2, 2020

Hi. I'd like to contribute. Please assign it to me.

@codetheorem
Copy link
Member Author

@prajwlr go ahead

Shivanshu97i added a commit to Shivanshu97i/Solve-It that referenced this issue Oct 16, 2021
vinayaksh42 added a commit that referenced this issue Oct 17, 2021
Added Solution to grid path #3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants