-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
fix: check index for next word and replace global index with local one #8719
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one comment, LG otherwise. Thanks for the PR
@mangalaman93 I need some help to pass the failed tests. |
rerunning the failed test. It is failing due to a known issue, we are looking into it. |
@mangalaman93 How can I re-run failed tests? |
Problem
nextWord()
used a global index and simply got the word from the list based on the index without checking if it's in the range.Solution
Pass the index as an argument to the function and let the callers maintain the index themselves (increase it here), and check if the index is valid.
I also fixed some typo and comments by the way.