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

check length if list of index to avoid index out of bound error #109

Open
SmitaPatankar opened this issue Aug 5, 2021 · 1 comment
Open

Comments

@SmitaPatankar
Copy link

if self.heap[1]:

It is directly checked as if lst[1].
This will give error if index does not exist in lst.
Instead, we need to check if len(lst) >= 2 i.e. whether 1st element exists or not.

@Parthiv31
Copy link

Hey have created a pr with the required change
do consider , if not do consider saying why not
Thank you

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

3 participants
@SmitaPatankar @Parthiv31 and others