← Salesforce questions

Minimum Toggles for Grid of Bulbs

Filed under Salesforce

Given an n x m grid of bulbs (on/off), toggling a bulb at (r, c) flips the state of itself and its four adjacent neighbors. Find the minimum number of toggles required to turn all bulbs off.

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Salesforce questions

Collected from public candidate posts and coding forums. Updated Nov 2026.