Showing 3 questions
Implement an iterator that cycles through multiple lists in a zigzag pattern. The iterator should return elements from each list in turn until all elements are exhausted.
#1. Zigzag Iterator
You are given a grid of oranges, some fresh, some rotten. Rotten oranges contaminate adjacent fresh oranges; find the minimum time until all oranges are rotten.
#2. Rotting Oranges
Given an array representing the height of bars, calculate how much water can be trapped between them after rain. Think about finding the maximum height to the left and right of each bar.
#3. Trapping Rain Water