【leetcode_easy_math】1523. Count Odd Numbers in an Interval Range

problem

1523. Count Odd Numbers in an Interval Range

solution#1: 分别计算0到low-1和0到high的奇数数目,然后做差即可。

code

solution#2:根绝high和low的奇偶性判断。

code

参考

1. leetcode_easy_math_1523. Count Odd Numbers in an Interval Range;

做自己该做的事情,做自己喜欢做的事情,安静做一枚有思想的技术媛。
版权声明,转载请注明出处:https://www.cnblogs.com/happyamyhope/
原文地址:https://www.cnblogs.com/happyamyhope/p/13936957.html