Skip to main content
LeetCode 1523, Easy. Topics: Math. View on LeetCode. Generate this problem as a practice environment: tested reference solution, 22 parametrized pytest cases, and a playground notebook:

Problem

Given two non-negative integers low and high. Return the count of odd numbers between low and high (inclusive).

Examples

Constraints

  • 0 <= low <= high <= 10^9

Solution

Reference implementation from solution.py on GitHub, full suite in test_solution.py:

Complexity

Tags

NeetCode All.
Last modified on September 7, 2026