1523. Count Odd Numbers in an Interval Range ¶ Time: $O(1)$ Space: $O(1)$ C++ 1 2 3 4 5 6class Solution { public: int countOdds(int low, int high) { return (high + 1) / 2 - low / 2; } };