GoldmanSachs | Analyst | 2 Decemeber 19

GoldmanSachs · Question · Posted Apr 2020

Given a string of 0 and 1 (0 indicates bulb is off , 1 indicated bulb is off) . Given range of indices : Add 1 to the indices. Print the number of values which are greater than equal to a given number d( No of toggle required to fuse the bulb). Return number of fused bulbs( Value=1 is considered toggled once) ---------- Ex: S: 010011 Q: [1,3] , [3,5], [0,2] d:2 Final string: 132222 Return val: 5

The full answer & interview discussion are available to premium members.

Log in Create a free account