1523. Count Odd Numbers in an Interval Range

Updated: 2024-03-12
1 min read
[]

On This Page

LeetCode problem 1523

class Solution:
    def countOdds(self, low: int, high: int) -> int:
        return ((high + 1) >> 1) - (low >> 1)