Saved Bookmarks
| 1. |
Toggle switchesYou are given a bulb connected with N switches. A swich can be either ON or OFF represented as #and respectively. The bulb will glow onlyMwhere (a) is the smallest integer that is greater than or equal to switches ON or set to 12There are queres where each query is given a switch position which is toggled.De the number of times the bulb changes its state from glowing to not glowing or vice versa.toge means changing a switch state from ON to OFF that means from 1 to 0 ot OFF 10 ON that means from 0 to 1The condition of switches is taken into considerationThe changes made by the queries are considered while evaluating the next queries.eng is used in the problem statementNE |
Answer» fPimEND5SZyqe-msvS9ZwW:APA91bFFxpSn-ZLCoSrkx2OG7K7azQk9Sfadsdn6plSL6mL9FHaZ4QTcEctMCVUz5ejyschMOoUDXJGIa0m_dV2K8FZSwI2R6R9co61kQPEbw0jWE0YkmQLuGkp9rAmNuca_M6EMa02aExplanation: fPimEND5SZyqe-msvS9ZwW:APA91bFFxpSn-ZLCoSrkx2OG7K7azQk9Sfadsdn6plSL6mL9FHaZ4QTcEctMCVUz5ejyschMOoUDXJGIa0m_dV2K8FZSwI2R6R9co61kQPEbw0jWE0YkmQLuGkp9rAmNuca_M6EMa02a |
|