葉林
Linked with GitHub
# LeetCode - 1523. Count Odd Numbers in an Interval Range ### 題目網址:https://leetcode.com/problems/count-odd-numbers-in-an-interval-range/ ###### tags: `LeetCode` `Easy` `數學` ```cpp= /* -LeetCode format- Problem: 1523. Count Odd Numbers in an Interval Range Difficulty: Easy by Inversionpeter */ class Solution { public: int countOdds(int low, int high) { return (high >> 1) + (high & 1) - (low >> 1); } }; ```
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up