You are given a mountain range represented by an array of length ****, where each element represents the initial altitude at that position.
altitude = [1, 2, 3, 2, 0]You are given a days matrix, where each row represents a single day and each column corresponds to the amount of snowfall at that specific length (index).
Example Calculation:
Day 1: days[0] = [1, 0, 1, 2, 1]
New Altitudes: [2, 2, 4, 4, 1] (Initial + Day 1 snow)
Day 2: days[1] = [1, 0, 1, 1, 0]
At index 1, there have been 2 consecutive days of 0 snowfall. Therefore, it melts by 1.
New Altitudes: [3, 1, 5, 5, 1]
A person can only move from index to index if the altitude difference is manageable:
Find the earliest day on which the mountain range becomes passable. If there are multiple ways to pass, find the path that requires the minimum number of climbs.