lc-go/solutions/15/q1523/solution.go
2026-01-12 21:53:52 +09:00

13 lines
179 B
Go

package q1523
func countOdds(low int, high int) int {
if low%2 == 1 {
low -= 1
}
if high%2 == 1 {
return (high-low)/2 + 1
}
return (high - low) / 2
}
var _ = countOdds