Skip to content

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

Open
@SmitaPatankar

Description

@SmitaPatankar

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions