Your question is Algorithm Implementation. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Bosch IoT Suite services maintain alert IDs in ascending order for efficient lookup. Given a sorted list of integer alert IDs and a target ID, return the target's zero-based index using binary search. Return -1 if the target is not present.
Implement search_alert_id(alert_ids, target).
alert_ids, a list of integers sorted in non-decreasing order, and target, an integer.target, or -1 when no matching ID exists.def search_alert_id(alert_ids, target):