Posted on:

30 Jul 2022

4

Cannot do the binary search properly without a sort :)

You must sort the list for the binary search to work properly. It worked for value 87 and 88 by accident but it doesn't work for values 6 and 70, for example, until you add at the beginning of the function this line of code: my_list.sort() . Now all tests will work. :))

0 answers ( 0 marked as helpful)

Submit an answer