10000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bbe0462 commit 498ab10Copy full SHA for 498ab10
src/algorithms/uncategorized/rain-terraces/bfRainTerraces.js
@@ -25,7 +25,7 @@ export default function bfRainTerraces(terraces) {
25
if (terraceBoundaryLevel > terraces[terraceIndex]) {
26
// Terrace will be able to store the water if the lowest of two left and right highest
27
// terraces are still higher than the current one.
28
- waterAmount += Math.min(leftHighestLevel, rightHighestLevel) - terraces[terraceIndex];
+ waterAmount += terraceBoundaryLevel - terraces[terraceIndex];
29
}
30
31
0 commit comments