ROCKWELL AUTOMATION | Off-Campus OA (2024) | Number of Laser Beams in a Bank
Question · Posted Jun 2026
Problem Statement A bank contains several rows of security devices represented as binary strings. '1' represents a security device. '0' represents an empty position. A laser beam is formed between two consecutive non-empty rows. The number of laser beams formed between two such rows is: (Number of devices in first row) × (Number of devices in second row) Return the total number of laser beams in the bank. Example Input: bank = ["011001","000000","010100","001000"] Output: 8 Explanation: Device counts: Row1 = ...
The full answer & interview discussion are available to premium members.
Log in Create a free account