Skip to content

Commit 7eb69dd

Browse files
authored
Create 1523. Count Odd Numbers in an Interval Range
1523. Count Odd Numbers in an Interval Range
1 parent 4230d2e commit 7eb69dd

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 l, int h) {
4+
return ((h + 1) / 2) - (l / 2);
5+
}
6+
};

0 commit comments

Comments
 (0)