Problem 1538 · Medium

Guess the Majority in a Hidden Array

Four-index probes reveal only whether bits agree; swap one index for a pivot to sort the array into two agreement classes and pick the larger.

Open the interactive visualisation