Skip to content

Commit 91b528d

Browse files
authored
Update 1494-parallel-courses-ii.js
1 parent a678a67 commit 91b528d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

1494-parallel-courses-ii.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,12 @@ const minNumberOfSemesters = function (n, dependencies, k) {
8787
function bitCnt(num) {
8888
let res = 0
8989
while(num) {
90-
if(num & 1) res++
91-
num = num >> 1
90+
num &= (num - 1)
91+
res++
9292
}
9393

9494
return res
9595
}
9696

9797

98+

0 commit comments

Comments
 (0)