Órbita baixaFlood fillAberto em 4 dez., 00:00
Dia 4: Chimney Hopper
Orimovo's habitat deck is a square grid of rooftops, and an elf has to visit as many chimneys as possible before the airlock cycles. Your input is a grid of digits; each digit is a roof's height from 0 to 9. The elf starts on the roof in the top-left corner.
From a roof the elf can hop to the roof directly up, down, left or right of it, as long as that roof is at most 1 higher. Dropping down any distance is fine. For example:
0128 1239 5541 9970
From the top-left 0 the elf can climb step by step to the 4 and both 5s, and drop to the 1 and 0 on the right. Only the 8, the two 9s on the left, the 9 on the right and the 7 are out of reach, so the elf can reach 11 roofs, counting the start.
How many roofs can the elf reach, including the start?
Ver o exemplo resolvido
Passo 8 de 80128123955419970
- reached
- 1
0128123955419970
- reached
- 3
0128123955419970
- reached
- 5
0128123955419970
- reached
- 6
0128123955419970
- reached
- 7
0128123955419970
- reached
- 9
0128123955419970
- reached
- 11
0128123955419970
- reached
- 11
