Skip to content

Commit aa9bef2

Browse files
committed
leetcode_1523
1 parent a9ac6c3 commit aa9bef2

File tree

1 file changed

+8
-0
lines changed

1 file changed

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

0 commit comments

Comments
 (0)