Skip to content

Commit eed392a

Browse files
committed
rollback: use original checking
1 parent 6f84790 commit eed392a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

longest-consecutive-sequence/tolluset.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,12 @@ function longestConsecutive(nums: number[]): number {
2828

2929
const isConsecutive = isLeft || isRight;
3030

31-
if (isConsecutive && (!isLeft || isRight)) {
31+
if (isConsecutive) {
3232
bucket[cursor].add(current);
33+
34+
if (isLeft && !isRight) {
35+
cursor++;
36+
}
3337
} else {
3438
cursor++;
3539
}

0 commit comments

Comments
 (0)