Skip to content

Commit b59ddea

Browse files
authored
Create 1523. Count Odd Numbers in an Interval Range1
1 parent d49016d commit b59ddea

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
class Solution {
2+
public:
3+
int countOdds(int low, int high) {
4+
return (high+(high&1)-low+(low&1))>>1;
5+
}
6+
};

0 commit comments

Comments
 (0)