Let indicate whether switch is pressed, with . A legal press toggles its own lamp from to . Only switch can otherwise change lamp . Hence
so . Scan left to right to find the only possible selection. If it is executable, its size is necessarily the minimum.