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

9.2 java #151

Open
jackxpeng opened this issue Apr 20, 2016 · 0 comments
Open

9.2 java #151

jackxpeng opened this issue Apr 20, 2016 · 0 comments

Comments

@jackxpeng
Copy link

https://github.com/careercup/ctci/blob/master/java/Chapter%209/Question9_2/QuestionDP.java#L39

Using the cache (dynamic programming) doesn't help in this case, where you are only looking for the first working path. Only the first working path can have any partial results to be saved.

It would, however, help in the case where you want to find all paths.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant