Write binary_search(sorted_nums, target) returning the index of target in a sorted list, or -1, using a while loop.
binary_search([1, 3, 5, 7, 9], 7) → 3
binary_search([1, 3, 5], 4) → -1
Submit runs 5 tests, including hidden edge cases.
Run your code to see the output here.