Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit498ab10

Browse files
Repeated Math operation (trekhleb#584)
Co-authored-by: Oleksii Trekhleb <trehleb@gmail.com>
1 parentbbe0462 commit498ab10

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎src/algorithms/uncategorized/rain-terraces/bfRainTerraces.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export default function bfRainTerraces(terraces) {
2525
if(terraceBoundaryLevel>terraces[terraceIndex]){
2626
// Terrace will be able to store the water if the lowest of two left and right highest
2727
// terraces are still higher than the current one.
28-
waterAmount+=Math.min(leftHighestLevel,rightHighestLevel)-terraces[terraceIndex];
28+
waterAmount+=terraceBoundaryLevel-terraces[terraceIndex];
2929
}
3030
}
3131

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp