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

What goes in the blank?

# stable merge step of merge sort
if left[i] ____ right[j]:
    out.append(left[i]); i += 1
else:
    out.append(right[j]); j += 1

Answer: <= (also accepted: <=)

On ties, taking from the left half keeps equal items in their original order, which is what makes merge sort stable. < still sorts but is not stable.
Play Problem Solving ▸