Problem 1966 · Medium

Binary Searchable Numbers in an Unsorted Array

Count elements that a binary search would find correctly wherever it lands in an unsorted array. The visual shows the search range for each candidate and which candidates survive.

Open the interactive visualisation