Company: phonepe_30july
Difficulty: medium
Song of Ice and Water Problem Description Imagine a magical ice crate with 8 slots in a row. Each slot can be filled with either ice (1) or water (0). Every day, the magic changes the state of each slot: If a slot has two neighbors that are both ice or both water, it will freeze (become ice). Otherwise, it will melt (become water). The first and last slots only have one neighbor each, so they always melt (become water) the next day. Given the initial state of the crate and a number n, return the state of the crate after n days. Input Format First line: 8 space-separated integers (0 or 1), representing the initial state of the crate. Second line: An integer n, the number of days. Output Format One line with 8 space-separated integers (0 or 1), representing the state of the crate after n days. Constraints 1 <= n <= 10^9 Examples Example 1: Input: 0 1 0 1 1 0 0 1 1 Output: 0 1 1 0 0 0 0 0 Explanation: Slot 0 and Slot 7 always become 0 (water) regardless of the neighbors, as per the