Pattern Recognition Drill
Easy Binary Search
The Problem
Given a sorted array and a target, return the index where the target would be inserted.
What approach would you use?
Think about it before scrolling down.
Standard binary search but return lo when not found. lo always points to the insert position. O(log n).
Common Trap
This is bisect_left. Know the difference between bisect_left and bisect_right.