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.
2 parents d49016d + b59ddea commit 944a8b5Copy full SHA for 944a8b5
1523. Count Odd Numbers in an Interval Range1
@@ -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