Leetcode 1630 Solution
This article provides solution to leetcode question 1630 (count-odd-numbers-in-an-interval-range)
Access this page by simply typing in "lcs 1630" in your browser address bar if you have bunnylol configured.
Leetcode Question Link
https://leetcode.com/problems/count-odd-numbers-in-an-interval-range
Solution
class Solution:
def countOdds(self, low: int, high: int) -> int:
return (high + 1) // 2 - low // 2