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

Problem in p35 - Gas station #49

Open
vendisky opened this issue Feb 11, 2015 · 1 comment
Open

Problem in p35 - Gas station #49

vendisky opened this issue Feb 11, 2015 · 1 comment

Comments

@vendisky
Copy link

vendisky commented Feb 11, 2015

Line 16: return total>=0 ? j+1 : -1
Should be (j+1)%gas.size(), so that we will return 0 instead of N in some cases.

@vendisky
Copy link
Author

Sorry, % is unnecessary here, by further analysis.

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