Skip to content

Commit 8ba3703

Browse files
authored
Update 1523-count-odd-numbers-in-an-interval-range.js
1 parent 628aab4 commit 8ba3703

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

1523-count-odd-numbers-in-an-interval-range.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,15 @@ const countOdds = function(low, high) {
1616

1717
return res
1818
};
19+
20+
21+
// another
22+
23+
/**
24+
* @param {number} low
25+
* @param {number} high
26+
* @return {number}
27+
*/
28+
const countOdds = function(low, high) {
29+
return ~~((high + 1) / 2) - (~~(low / 2))
30+
};

0 commit comments

Comments
 (0)