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 39f7e8e commit 3c9ea58Copy full SHA for 3c9ea58
house-robber/lhc0506.js
@@ -11,7 +11,7 @@ var rob = function(nums) {
11
let oneBefore = 0;
12
13
nums.forEach(num => {
14
- const prevOneBefore = oneBefore
+ const prevOneBefore = oneBefore;
15
oneBefore = Math.max(prevOneBefore, twoBefore + num);
16
twoBefore = prevOneBefore;
17
});
0 commit comments