Increase Solar-Powered Bulbs to the Maximum
I'd be more than happy to modify if anything is not clear or you have any better idea to make it more understandable. π€
As we all know, solar power consumption has long been a significant rise in recent years, largely due to growing concerns over global warming and the need for sustainable energy solutions.
As part of their commitment to environmental responsibility, some FastPrep.io offices π have decided to take a step toward energy efficiency by replacing a portion of their traditional electricity-powered bulbs with more sustainable solar-powered bulbs.
For clarity, in this context, an electricity-powered bulb refers to one that is connected to a wired power supply, while a solar-powered bulb is one that operates independently using energy harnessed from solar panels.
In one such office, the lights are arranged in a sequential manner, represented by a binary sequence called bulbs. Within this sequence, electricity-powered bulbs are denoted by '0', whereas solar-powered bulbs are represented by '1'.
Since the goal is to maximize the number of solar-powered bulbs in the office while maintaining adequate brightness, a key constraint must be observed: an electricity-powered bulb can only be replaced by a solar-powered bulb if the replacement does not result in two adjacent solar-powered bulbs. More formally, a '0' in the sequence can be changed to a '1' only if it does not become directly adjacent to another '1' after replacement. It is important to note that the initial configuration of bulbs may already contain adjacent solar-powered bulbs, and this constraint applies only to newly added ones.
Given this setup, the task is to determine the maximum possible number of solar-powered bulbs that can be achieved after making replacements according to the given conditions. The result should reflect the total count of solar-powered bulbs in the final arrangement, rather than just the number of bulbs that were replaced.
One other task is to come to office to replace the bulbs based on your most optimized solution after accepting the offer π€£
What parameters do we have this time? π€ -- String lights, which is a string representing the current arrangement of bulbs
If doing right, you will be able to return the max num of solar bulbs that can be replaced in the office π
Thank you freya, for saving this question π
1Example 1

Constraints
Limits and guarantees your solution can rely on.
An unknown myth for now