Spot the bug: Binary search that misses the last element

easy
Binary search

Bug 1 of 12

This Python solution is supposed to do the following: Return the index of target in the sorted list nums, or -1 if it isn't there. It has one bug. Find the line in two tries.

Tap the line with the bug

2 tries left

FAQ