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

GetN method may fall into infinite loop #32

Open
power-more opened this issue Apr 24, 2024 · 0 comments
Open

GetN method may fall into infinite loop #32

power-more opened this issue Apr 24, 2024 · 0 comments

Comments

@power-more
Copy link

When I only have 2 elements, but execute Add 3 times, at this time c.count == 3, after that GetN(3) is executed, if start == 0, then the for loop will fall into an infinite loop, because i can never Return to 0, which means that the exit condition of start != i cannot be met, because the minimum value of i is 1, and len(res) is 2, which is always less than n, and the loop cannot exit.

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