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

What goes in the blank?

from collections import deque
q = deque()
# take from the front in O(1)
node = q.____()

Answer: popleft (also accepted: popleft, popleft())

popleft is constant time on a deque, unlike list.pop(0).
Play Problem Solving ▸