$ ./guess_the_languageProblem Solving — fill the blank
Problem Solving — fill the blank · medium · #268

What goes in the blank?

import heapq
# smallest element first
heapq.____(heap, value)

Answer: heappush (also accepted: heappush, heappush())

heappush keeps the min-heap invariant; heappop removes the smallest.
Play Problem Solving ▸