Back to problems

Python Debugging — Fix a Loop Condition Bug

AI Coding · Apple · Easy

A small Python package wraps the binary search routine the post gives: src/search.py contains the routine; src/io_utils.py parses the three-line input; main.py wires them together as a stdin tool. The task is the same as the post: repair the routine in src/search.py so it locates target in a strictly increasing sorted list and returns its index (or -1 when the value is absent). What the routine has to do The routine takes a strictly increasing nums and an integer target. It…

Checking your access…