Company: Josh technology_15july
Difficulty: medium
Smart Ice Shelf Problem Description You work at a tech company developing a smart, temperature-controlled shelf for an experimental kitchen. The shelf consists of a row of temperature modules, each of which can either heat, cool, or stay neutral. After the shelf is used, the modules may end up in a mixed state – some set to heat, some to cool, and others unchanged. A positive number represents a heated module (emits heat) A negative number represents a cooled module (absorbs heat) A zero represents a neutral module (no effect) To simplify this setup, the shelf includes a self-balancing button. When pressed, the shelf performs a cleanup cycle to resolve local conflicts between adjacent modules: It scans the modules once from left to right. If a heating module (+) is immediately followed by a cooling module (-), the two conflict. For every conflict, the cooling module is always removed because the heating module overpowers it, regardless of their magnitude. Neutral modules (0) do not int