AirbnbSoftware Engineer · OnsiteCodemia practiceSimulate Water Settling on a Terrain Elevation Profile
Given an array of terrain heights, a number of water units, and a drop index, release the units one at a time at that index. Each unit flows left if moving left lets it eventually reach a lower level, otherwise right under the same rule, otherwise it stays put; return the final combined heights.
Medium
Coding & Algorithms