educative.io

Get() could return expired item

When get() is called we return the item without checking the expiration time, which evidently means we are returning stale data.
If we add a check for expiration time, are we are required to remove that from the heap in the same method then the time complexity will become O(logN)